Section 1Understand Problem
Section 01
Understand the problem
Restate the problem precisely. Interviewers reward candidates who pause, define the contract, and name the guarantees before coding.
Problem statement
Koko loves to eat bananas. There are n piles of bananas, the *i*-th pile has `piles[i]` bananas. The guards have gone and will come back in `h` hours. Koko can decide her bananas-per-hour eating speed of `k`. Each hour she chooses some pile of bananas and eats `k` bananas from that pile. If the pile has less than `k` bananas, she eats all of them and will not eat any more bananas during this hour. Return the minimum integer `k` such that she can eat all the bananas within `h` hours.
Example
piles = [3, 6, 7, 11], h = 8 → 4
Constraints
1 ≤ piles.length ≤ 10⁴ · piles.length ≤ h ≤ 10⁹ · 1 ≤ piles[i] ≤ 10⁹
Audio recording unsupported on this browser.
WPM—Fillers0Pace—Thinking0%
Explain the problem in your own words
0 words0 chars
AI Review
Write your thinking above first.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.
Ready to submit Section 1?
The reviewer will check whether you stated inputs, output, guarantees, and any assumption you flagged.
Write at least a couple of sentences explaining the problem before submitting.