Skip to content

Commit e952b64

Browse files
committed
#875: description update
1 parent 06b7e87 commit e952b64

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

c-sharp/Problems/binary-search/KokoEatingBananas.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,34 @@
33
* Koko Eating Bananas
44
**
55
* Koko loves to eat bananas.
6-
* There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.
6+
* There are n piles of bananas, the ith pile has piles[i] bananas.
7+
* The guards have gone and will come back in h hours.
78
*
89
* Koko can decide her bananas-per-hour eating speed of k.
910
* Each hour, she chooses some pile of bananas and eats k bananas from that pile.
10-
* If the pile has less than k bananas, she eats all of them instead and will not eat any more bananas during this hour.
11+
* If the pile has less than k bananas,
12+
* she eats all of them instead and will not eat any more bananas during this hour.
1113
*
1214
* Koko likes to eat slowly but still wants to finish eating all the bananas before the guards return.
1315
*
1416
* Return the minimum integer k such that she can eat all the bananas within h hours.
17+
*
18+
* Example 1:
19+
* Input: piles = [3,6,7,11], h = 8
20+
* Output: 4
21+
*
22+
* Example 2:
23+
* Input: piles = [30,11,23,4,20], h = 5
24+
* Output: 30
25+
*
26+
* Example 3:
27+
* Input: piles = [30,11,23,4,20], h = 6
28+
* Output: 23
29+
*
30+
* Constraints:
31+
* • 1 <= piles.length <= 10^4
32+
* • piles.length <= h <= 10^9
33+
* • 1 <= piles[i] <= 10^9
1534
**
1635
* https://leetcode.com/problems/koko-eating-bananas/
1736
***/

0 commit comments

Comments
 (0)