Minimum Eating Speed
Problem Overview
- Find the minimum candies-per-hour rate c to finish all piles within numHours, eating from only one pile per hour.
- Input: int[] candyPiles, int numHours. Output: int c, the smallest rate to finish before Alex wakes.
- Real-world context: post–trick-or-treat candy piles; Alex sleeps while you eat under hourly limits.
- Rule: each hour choose one pile; you eat up to c, or the pile’s remaining if smaller.
- From Airbnb interviews; a classic coding interview problem and interview question.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
