You are given two integers
numBottlesandnumExchange.
numBottlesrepresents the number of full water bottles that you initially have. In one operation, you can perform one of the following operations:
- Drink any number of full water bottles turning them into empty bottles.
- Exchange
numExchangeempty bottles with one full water bottle. Then, increasenumExchangeby one.Note that you cannot exchange multiple batches of empty bottles for the same value of
numExchange. For example, ifnumBottles == 3andnumExchange == 1, you cannot exchange3empty water bottles for3full bottles.Return the maximum number of water bottles you can drink.
1 | class Solution { |