Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93061f3

Browse files
committed
Time: 0 ms (100.00%) | Memory: 41 MB (57.42%) - LeetSync
1 parent 5505c3c commit 93061f3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public int maxBottlesDrunk(int numBottles, int numExchange) {
3+
int ans = numBottles;
4+
int empty = numBottles;
5+
6+
while(empty>=numExchange) {
7+
ans++;
8+
empty -= numExchange;
9+
empty++;
10+
numExchange++;
11+
}
12+
return ans;
13+
}
14+
}

0 commit comments

Comments
 (0)