Rotting oranges

0
Remix

In a grid, cells are empty, fresh fruit or rotten fruit. Each minute, fresh fruit next to rotten fruit (up, down, left, right) rots. Return the minutes until no fresh fruit is left, or -1 if some never rots. Use multi-source breadth-first search.

AmazonCodingLast asked Jul 2025
No answer yet. Write the first one; the best answer gets endorsed.