Walls and Gates — Graphs: BFS/DFS

Fill each open room on a floor map with its shortest walking distance to the nearest exit, leaving unreachable rooms unmeasured.

Graphs: BFS/DFS · Medium

More in Graphs: BFS/DFS

All algorithm problems