- You are given, no of rows(n) and no of columns(m)
- You are given n*m numbers, representing elements of 2d arrays.
- You are required to traverse and print the contents of the 2d array in form of a spiral.
Example 1:
Input: n=3, m=5, arr[][] = {11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35}
Output: 11 21 31 32 33 34 35 25 15 14 13 12 22 23 24
Constraints:
1 <= n <= 10^2
1 <= m <= 10^2
-10^9 <= e1, e2, .. n * m elements <= 10^9