spiral order matrix

🏠
1 m = [[1,2,3],
2    [4,5,6],
3    [7,8,9]]
4 
5 def spiralOrder(m):
6     return m and [*m.pop(0)] + spiralOrder([*zip(*m)][::-1])
7   
8 spiralOrder(m)

See also:

matrix transpose

matrix anticlockwise rotation