#795Medium#2 in Bloomberg's list· asked at 33 companies
Koko eating bananas
Hosted on LeetCode
Solve it on LeetCode, track it here.
This problem's full statement lives on LeetCode. Open it in a new tab, then come back to mark it solved, add notes and keep your streak.
LeetCode Premium locked?
Most company-tagged LeetCode problems are behind Premium. If you have ChatGPT Plus or Claude Pro, ask it for the full statement, examples and constraints. The buttons below open a chat with the prompt already filled in.
What we know
Example 1
Input: piles = [3,6,7,11], h = 8 Output: 4
Example 2
Input: piles = [30,11,23,4,20], h = 5 Output: 30
Example 3
Input: piles = [30,11,23,4,20], h = 6 Output: 23
Constraints
- •
1 <= piles.length <= 10^4 - •
piles.length <= h <= 10^9 - •
1 <= piles[i] <= 10^9