← All problems
Rotting Oranges
Minutes until no fresh orange remains (4-directional spread per minute); -1 if impossible.
Complexity
Time O(mn), Space O(mn)
Common pitfalls
- BFS from each rotten separately (wrong timing)
- Forgetting the impossible case
Your solution
Log in to save your code and track progress.