Log in
← All problems

Spiral order

hardLists40 XP

Return the numbers of matrix (a list of equal-length rows) in spiral order: along the top row, down the right side, back along the bottom and up the left, then the same again further in.

Examples

Examples use JSON: true/false/null are True/False/None in Python.

Run examples checks the examples above. Submit also runs 4 hidden tests.