Traverse matrix in L shape
Given a N * M matrix. The task is to traverse the given matrix in L shape as shown in below image. Examples: Input : n = 3, m = 3 a[][] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } } Output : 1 4 7 8 9 2 5 6 3 Input : n = 3, m = 4 a[][] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12} } Output : 1 4 7 10 11 12 2 5 8 9 3 6 Observe there will be