AlgoMaster Logo

Rotting Oranges

grid=[[2,1,1],[1,1,0],[0,1,1]]
0 / 45
minute0fresh62111111queuemulti-source BFS: rot spreads to neighbors each minute
algomaster.io
Step:Spread rot outward from every initially rotten orange