You start with numBottles full water bottles.
Whenever you drink a bottle, it becomes empty.
You can exchange numExchange empty bottles for 1 full bottle.
Your task is to calculate the maximum number of bottles you can drink if you repeatedly drink full bottles and exchange empty ones as long as possible.
Input: numBottles = 9, numExchange = 3
Output: 13
Explanation:
Drink 9 → you have 9 empty Exchange 9 / 3 = 3 full → drink → 3 empty Exchange 3 / 3 = 1 full → drink → 1 empty Total drinks: 9 + 3 + 1 = 13
Input: numBottles = 15, numExchange = 4
Output: 19
Explanation:
Drink 15 → 15 empty Exchange → 3 full → drink → 3 empty Exchange → 0 full (not enough) Total = 15 + 3 + 1 = 19
Accepted:
Submission: