Skip to content

Commit f4f9620

Browse files
committed
Create 3100-WaterBottlesII.cpp
1 parent 5e3aa71 commit f4f9620

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

3100-WaterBottlesII.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution {
2+
public:
3+
int maxBottlesDrunk(int numBottles, int numExchange) {
4+
int total(numBottles); int nz(numBottles);
5+
while(nz >= numExchange){++total; nz-= numExchange; ++nz; ++numExchange;}
6+
return total;
7+
}
8+
};

0 commit comments

Comments
 (0)