OpenAI·Software Engineer·Technical Phone Screen
- You're given an m x n grid where each cell is either empty, a fresh orange, or a rotten orange. Each minute, a fresh orange adjacent (in 4 directions) to a rotten one also becomes rotten. What's the minimum number of minutes until no fresh oranges remain? Return -1 if it's not possible.
“The BFS part clicked pretty fast but I almost started with a single-source approach and would've gotten the wrong answer.”