Koko Eating Bananas
Medium
Binary Search
There are n piles of bananas. Koko eats at a speed of k bananas per hour; in one hour she picks one pile and eats up to k bananas from it (if the pile has fewer, she finishes it and waits). She must finish all piles within h hours. Print the minimum integer k that works.
Constraints
1 <= n <= h <= 10^9 1 <= pile <= 10^9
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.