Koko loves to eat bananas. There are n piles of bananas, and the i-th pile has piles[i] bananas. The guards have gone and will come back in h hours.
Koko can decide her eating speed k (bananas per hour). Each hour, she chooses a pile and eats k bananas from it. If the pile has fewer than k bananas, she eats all of them and does not eat any more bananas in that hour.
Koko wants to finish all bananas before the guards return. Return the minimum integer k such that she can eat all bananas within h hours.
Input: piles = [3, 6, 7, 11], h = 8 Output: 4 Explanation: At speed 4, pile sizes take ceil(3/4)+ceil(6/4)+ceil(7/4)+ceil(11/4) = 1+2+2+3 = 8 hours. Speed 3 takes 9 hours (too slow).
Input: piles = [30, 11, 23, 4, 20], h = 5 Output: 30 Explanation: With 5 piles and exactly 5 hours, Koko must finish each pile in one hour, so she needs k >= max(piles) = 30.
1 <= piles.length <= 10^4piles.length <= h <= 10^91 <= piles[i] <= 10^9piles = [3, 6, 7, 11], h = 8