Problem 994 · Medium

Rotting Oranges

Run multi-source BFS over the grid, propagating rotting level by level until all fresh oranges are processed.

Open the interactive visualisation