← Questions

Minimum hourly rate to empty every vault in time

0
UberCodingLast asked Sep 2025

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.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding