Spiral Matrix — walk and turn at the walls
Move in one direction until the next cell would leave the grid or repeat a visited cell, then turn clockwise. Repeat until every cell is collected.
Try: