Problem 1162 · Medium

As Far from Land as Possible

On a grid of land and water, find the water cell whose nearest land cell is as far away as possible. The visual grows a wave outward from all land cells at once, one ring per step.

Open the interactive visualisation