~/boss / spiral-dungeon

Spiral order (four walls)

The Spiral Vault

Loot every cell in a spiral. Walk a wall, then move it in.

Loading the fight…

How to beat it

Keep four walls: top, bottom, left and right. Walk along the top wall, then move it down. Walk down the right wall, then move it left. Then the bottom wall, right to left, and the left wall, going up. Keep going until two walls cross: every cell visited exactly once.

Now the real boss

Interviews ask for the code. Watch it run, then write it yourself, tested in Python, C++ or Java.

On your phone? Writing code is easier on a laptop: open bossfight.dev/problems/spiral-matrix there. Sign in with your email to keep your progress on every device.

More bosses

esc