Rotting Oranges

Graphs · multi-source BFS · Expand one minute at a time · Stretch · about 28 min

Why it matters

Multi-source BFS is a reusable pattern for nearest-distance and spread problems.

How it connects

Level-order traversal becomes a clock when every starting source enters the queue together.

Try first

Which oranges should be in the queue before the first minute begins?

Interview cue

The queue layer is one minute of simultaneous spread, starting from all initial sources.