Problem 885 · Medium

Spiral Matrix III

Walk an outward clockwise spiral of growing legs and record only the cells that fall inside the grid.

Open the interactive visualisation