Spiral Matrix Traversal

easy
Unit 6 · Matrices0/3 to milestone

Implement spiral_order(matrix) returning the elements of a 2-D list in clockwise spiral order, starting at the top-left. Then implement spiral_fill(n), which builds an n × n matrix filled with 1 … n² in spiral order.

The matrix may be rectangular or empty.

#matrices#simulation2 visible + 2 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Spiral Matrix Traversal · TechGradify