Rotting Oranges
Signals to notice
Brute force first
Simulate minute by minute from each rotten orange independently. Re-processes already-rotten oranges. 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
Multi-source BFS: start with ALL rotten oranges in the queue simultaneously. Each BFS level = one minute of spreading. Count levels until all fresh oranges are rotten. Instead of recomputing the world every time, you preserve just enough context to let the next decision become obvious.
What must stay true
All rotten oranges spread simultaneously — that's multi-source BFS. Each level of the BFS represents one minute. The number of levels (minus 1) is the answer. As long as that statement keeps holding, you can trust the steps built on top of it.
Easy way to go wrong
Starting BFS from only one rotten orange — all rotten oranges spread in parallel. Initialize the queue with ALL of them. When the code becomes mechanical before the idea is clear, small edge cases start breaking the whole story.