Consider an
Any fresh orange that is 4–directionally adjacent to a rotten orange will also turn rotten with each passing minute.
Your task is to determine the minimum time required for all cells to have rotten oranges. In case, this objective cannot be achieved, return
Constraints:
m grid.length
n grid[i].length
m, n
grid[i][j] is 0, 1, or 2.
Consider an
Any fresh orange that is 4–directionally adjacent to a rotten orange will also turn rotten with each passing minute.
Your task is to determine the minimum time required for all cells to have rotten oranges. In case, this objective cannot be achieved, return
Constraints:
m grid.length
n grid[i].length
m, n
grid[i][j] is 0, 1, or 2.