0994. Rotting Oranges
Last updated
Last updated
**Input:** grid = [[2,1,1],[1,1,0],[0,1,1]]
**Output:** 4**Input:** grid = [[2,1,1],[0,1,1],[1,0,1]]
**Output:** -1
**Explanation:** The orange in the bottom left corner (row 2, column 0) is never rotten, because rotting only happens 4-directionally.**Input:** grid = [[0,2]]
**Output:** 0
**Explanation:** Since there are already no fresh oranges at minute 0, the answer is just 0.