Search
⌘K

Leetcode 994. Rotting Oranges

Given an m×n grid with empty cells, fresh (1) and rotten (2) oranges, compute the minimum minutes until all fresh oranges become rotten as rot spreads 4-directionally each minute, returning -1 if any fresh orange is unreachable. This is a multi-source BFS/level-order propagation problem starting from all initial rotten oranges.

Asked at:

Amazon

Amazon


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early September, 2025

Amazon

Amazon

Junior

Late October, 2024

Amazon

Amazon

Junior

Rotting oranges (variation and optimized code) - graph problem

Comments

Your account is free and you can post anonymously if you choose.