Problem. There are piles[i] bananas in pile i. Each hour, Koko picks one pile and eats up to k bananas from
it; if the pile has fewer than k, she finishes it and waits out the hour. She has h hours (h ≥ len(piles)).
Return the minimum integer speed k that lets her finish everything in time.
piles = [3, 6, 7, 11], h = 8 → 4
piles = [30, 11, 23, 4, 20], h = 5 → 30
piles = [30, 11, 23, 4, 20], h = 6 → 23
At speed k, pile p takes ceil(p / k) hours, so the total is hours(k) = Σ ceil(p / k). We want the smallest k with
hours(k) ≤ h.
ML context. This is the shape of every capacity question: the smallest throughput, worker count or memory budget that meets a deadline. The minimum tokens per second per worker to process a dataset by morning, the fewest GPUs that serve a load at a target latency, the smallest stage size when splitting a model into pipeline stages (Change C). There's no array to search: you search the answer.