You are given two integers
numBottles
andnumExchange
.
numBottles
represents 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
numExchange
empty bottles with one full water bottle. Then, increasenumExchange
by one.Note that you cannot exchange multiple batches of empty bottles for the same value of
numExchange
. For example, ifnumBottles == 3
andnumExchange == 1
, you cannot exchange3
empty water bottles for3
full bottles.Return the maximum number of water bottles you can drink.
1 | class Solution { |