← Questions
Walls and gates
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A grid holds walls, gates and empty rooms. Fill every empty room with the distance to its nearest gate, leaving rooms that cannot reach a gate untouched. Use one multi-source BFS starting from all gates.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
