Koko Eating Bananas
Signals to notice
Brute force first
Try every speed from 1 to max(piles) and simulate. Tests every possible speed linearly. That direct path helps you understand the question, but it tends to treat every possibility as brand new instead of learning from earlier steps.
The key insight
Binary search on the speed: for each candidate speed, check if Koko can finish all piles in h hours. The check is, and binary search reduces candidates from max to log(max). Total. Instead of recomputing the world every time, you preserve just enough context to let the next decision become obvious.
What must stay true
If Koko can finish at speed k, she can finish at any speed > k. If she can't finish at speed k, she can't at any speed < k. This monotonicity makes binary search valid. As long as that statement keeps holding, you can trust the steps built on top of it.
Easy way to go wrong
The ceiling division: hours for one pile = ceil(pile / speed), not floor. Forgetting ceiling means underestimating the time. Most mistakes here are not about syntax; they come from losing track of what your state, pointer, or structure is supposed to mean.