Easy
直接照着题目意思思考
以上,AC!
python3
class Solution:
def numWaterBottles(self, numBottles: int, numExchange: int) -> int:
empty = numBottles
res = numBottles
while empty // numExchange > 0:
e = empty // numExchange
res += e
empty = empty % numExchange + e
return res