Koko has piles[i] bananas. The guards have left and will return in h hours, and Koko must finish all the bananas before they come back.
Before eating, Koko chooses an integer as an eating speed
In each hour, Koko selects one pile of bananas and eats from it according to the following rules:
If the pile contains at least
If the pile contains fewer than
Your task is to return the minimum eating speed h hours before the guards return.
Constraints:
piles.length
piles.length h
piles[i]
Koko has piles[i] bananas. The guards have left and will return in h hours, and Koko must finish all the bananas before they come back.
Before eating, Koko chooses an integer as an eating speed
In each hour, Koko selects one pile of bananas and eats from it according to the following rules:
If the pile contains at least
If the pile contains fewer than
Your task is to return the minimum eating speed h hours before the guards return.
Constraints:
piles.length
piles.length h
piles[i]