We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fd476e commit 776c69dCopy full SHA for 776c69d
src/main/java/com/fishercoder/solutions/secondthousand/_1518.java
@@ -3,15 +3,15 @@
3
public class _1518 {
4
public static class Solution1 {
5
public int numWaterBottles(int numBottles, int numExchange) {
6
- int drunk = numBottles;
+ int drank = numBottles;
7
int emptyBottles = numBottles;
8
while (emptyBottles >= numExchange) {
9
int exchangedBottles = emptyBottles / numExchange;
10
- drunk += exchangedBottles;
+ drank += exchangedBottles;
11
int unUsedEmptyBottles = emptyBottles % numExchange;
12
emptyBottles = exchangedBottles + unUsedEmptyBottles;
13
}
14
- return drunk;
+ return drank;
15
16
17
0 commit comments