Slowest eating speed that works
Mediumbinary searcharray
There are banana piles piles and h hours. Each hour you pick a pile and eat k bananas from it (finishing a smaller pile and waiting out the hour). Return the smallest k that finishes everything within h hours.
Example 1
Input: piles = [3,6,7,11], h = 8 Output: 4
Example 2
Input: piles = [30,11,23,4,20], h = 5 Output: 30
Constraints
- 1 ≤ piles.length ≤ 10⁴
- piles.length ≤ h ≤ 10⁹
- 1 ≤ piles[i] ≤ 10⁹
Submit checks your solution against 9 tests, including hidden ones.
/**
* @param {int[]} piles
* @param {int} h
* @return {int}
*/
function minEatingSpeed(piles, h) {
}