You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the market with one full water bottle.
10
+
11
+
The operation of drinking a full water bottle turns it into an empty bottle.
12
+
13
+
Given the two integers numBottles and numExchange, return the maximum number of water bottles you can drink.
14
+
15
+
16
+
17
+
Example 1:
18
+
19
+
20
+
Input: numBottles = 9, numExchange = 3
21
+
Output: 13
22
+
Explanation: You can exchange 3 empty bottles to get 1 full water bottle.
23
+
Number of water bottles you can drink: 9 + 3 + 1 = 13.
24
+
Example 2:
25
+
26
+
27
+
Input: numBottles = 15, numExchange = 4
28
+
Output: 19
29
+
Explanation: You can exchange 4 empty bottles to get 1 full water bottle.
30
+
Number of water bottles you can drink: 15 + 3 + 1 = 19.
0 commit comments