As reported: Salesforce MTS loop (Bengaluru, Oct 2025), round 1: two questions in one hour — the shortest subarray with
kdistinct values (returning its indices), then this one.
This is LeetCode 875 — Koko Eating Bananas.
There are piles[i] bananas in pile i. Koko eats at speed k bananas per hour: each hour she picks one pile and eats k bananas from it (or the whole pile if it has fewer, and then waits for the hour to end). Return the minimum integer k that lets her eat everything within h hours.
Example 1
piles = [3,6,7,11], h = 8
Output: 4
Example 2
piles = [30,11,23,4,20], h = 5
Output: 30
Example 3
piles = [30,11,23,4,20], h = 6
Output: 23
Constraints: 1 ≤ piles.length ≤ 10^4; piles.length ≤ h ≤ 10^9; 1 ≤ piles[i] ≤ 10^9.
Code runner format: one JSON value per line: piles, then h. Implement minEatingSpeed(piles, h); the harness prints k.