Spiral matrix
Question
Given a matrix with m x n
dimensions, print its elements in spiral form.
For example:
#Given:
a = [ [10, 2, 11],
[1, 3, 4],
[8, 7, 9] ]
#Your function should return:
10, 2, 11, 4, 9, 7, 8, 1, 3
Given a matrix with m x n
dimensions, print its elements in spiral form.
For example:
#Given:
a = [ [10, 2, 11],
[1, 3, 4],
[8, 7, 9] ]
#Your function should return:
10, 2, 11, 4, 9, 7, 8, 1, 3