Skip to content

#875 - Koko Eating Bananas

MediumBinary Search
Open on LeetCode

Koko has piles of bananas and h hours. She eats at speed k bananas/hour (one pile at a time, even if k exceeds the pile). Return the minimum k such that she can eat all bananas within h hours.

InputOutput
piles = [3,6,7,11], h = 84
piles = [30,11,23,4,20], h = 530
piles = [30,11,23,4,20], h = 623

Released under the MIT License.