Problem 2812 · Medium

Find the Safest Path in a Grid

Measure each cell’s distance to the nearest thief with a multi-source BFS, then search for the path whose weakest cell is as safe as possible.

Open the interactive visualisation