Given a 2 dimensional array M x N , transform it into a one dimensional array traversing from the the outer edges of the array to the inner edges in a square like fashion In other words covert this: [ [ 11,15, 5, 2,16], [ 1,19,12, 0, 8 ], [ 6,17, 9,10,18 ], [ 7, 3,14,13, 4 ]] Into: [ 11, 15, 5, 2, 16, 8, 18, 4, 13, 14, 3, 7, 6, 1, 19, 12, 0, 10, 9, 17 ]