Minimum hourly rate to empty every vault in time

0
Remix

A row of vaults holds vaults[i] units each, and there are h hours. Each hour you can take up to k units from one vault only; leftover capacity in that hour does not carry over to another vault.

Return the smallest integer k that empties every vault within h hours. This is the Koko-eating-bananas problem: binary search on k with a greedy check.

UberTechnical phone screenLast asked Sep 2025
No answer yet. Write the first one; the best answer gets endorsed.