Skip to content

Commit c002bd5

Browse files
authored
Create maxBottlesDrunk.py
1 parent a71618f commit c002bd5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

maths/maxBottlesDrunk.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution(object):
2+
def maxBottlesDrunk(self, numBottles, x):
3+
ans = numBottles
4+
while numBottles >= x:
5+
numBottles -= x - 1
6+
x += 1
7+
ans += 1
8+
return ans

0 commit comments

Comments
 (0)