|
| 1 | +<h2>unknown-problem</h2><h3>Easy</h3><hr><div><p>Given <code>numBottles</code> full water bottles, you can exchange <code>numExchange</code> empty water bottles for one full water bottle.</p> |
| 2 | + |
| 3 | +<p>The operation of drinking a full water bottle turns it into an empty bottle.</p> |
| 4 | + |
| 5 | +<p>Return the <strong>maximum</strong> number of water bottles you can drink.</p> |
| 6 | + |
| 7 | +<p> </p> |
| 8 | +<p><strong>Example 1:</strong></p> |
| 9 | + |
| 10 | +<p><strong><img alt="" src="https://assets.leetcode.com/uploads/2020/07/01/sample_1_1875.png" style="width: 480px; height: 240px;"></strong></p> |
| 11 | + |
| 12 | +<pre><strong>Input:</strong> numBottles = 9, numExchange = 3 |
| 13 | +<strong>Output:</strong> 13 |
| 14 | +<strong>Explanation:</strong> You can exchange 3 empty bottles to get 1 full water bottle. |
| 15 | +Number of water bottles you can drink: 9 + 3 + 1 = 13. |
| 16 | +</pre> |
| 17 | + |
| 18 | +<p><strong>Example 2:</strong></p> |
| 19 | + |
| 20 | +<p><img alt="" src="https://assets.leetcode.com/uploads/2020/07/01/sample_2_1875.png" style="width: 790px; height: 290px;"></p> |
| 21 | + |
| 22 | +<pre><strong>Input:</strong> numBottles = 15, numExchange = 4 |
| 23 | +<strong>Output:</strong> 19 |
| 24 | +<strong>Explanation:</strong> You can exchange 4 empty bottles to get 1 full water bottle. |
| 25 | +Number of water bottles you can drink: 15 + 3 + 1 = 19. |
| 26 | +</pre> |
| 27 | + |
| 28 | +<p><strong>Example 3:</strong></p> |
| 29 | + |
| 30 | +<pre><strong>Input:</strong> numBottles = 5, numExchange = 5 |
| 31 | +<strong>Output:</strong> 6 |
| 32 | +</pre> |
| 33 | + |
| 34 | +<p><strong>Example 4:</strong></p> |
| 35 | + |
| 36 | +<pre><strong>Input:</strong> numBottles = 2, numExchange = 3 |
| 37 | +<strong>Output:</strong> 2 |
| 38 | +</pre> |
| 39 | + |
| 40 | +<p> </p> |
| 41 | +<p><strong>Constraints:</strong></p> |
| 42 | + |
| 43 | +<ul> |
| 44 | + <li><code>1 <= numBottles <= 100</code></li> |
| 45 | + <li><code>2 <= numExchange <= 100</code></li> |
| 46 | +</ul></div> |
0 commit comments