换酒问题
题目描述:
题目链接
Python3
class Solution:
def numWaterBottles(self, numBottles: int, numExchange: int) -> int:
drink = 0
Full = numBottles
Empty = 0
while True:
drink += Full
Empty += Full
Full = Empty // numExchange
Empty %= numExchange
if Full == 0:
break
return drink