空酒瓶问题
空酒瓶问题:小区便利店正在促销,用 numExchange 个空酒瓶可以兑换一瓶新酒。你购入了 numBottles 瓶酒。如果喝掉了酒瓶中的酒,那么酒瓶就会变成空的。请你计算 最多 能喝到多少瓶酒。来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/water-bottlescount=0def numWater(numBottles, numExchange): if numBottles>=numExchange:
原创
2020-12-31 13:49:51 ·
249 阅读 ·
0 评论