Instead of searching an array, you search over possible eating speeds. The key insight: if speed works, any speed also works. This monotonicity enables binary search.
Search range: .
For each candidate speed mid, compute total hours needed: .
If hours , the speed works. Try smaller speeds (set right = mid).
If hours , speed is too slow. Set left = mid + 1.
Return left as the minimum valid speed.