Given a matrix
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
Unroll it as a spiral by printing first the top row, then the last column, then the bottom row backwards, etc.
The expected output of the above matrix is the following:
1 2 3 4 5 10 15 20 19 18 17 16 11 6 7 8 9 14 13 12
It is ok if the matrix is hardcoded in your program as a list of lists.