- You are given a number n, representing the number of rows and columns of a square matrix.
- You are given n * n numbers, representing elements of 2d array a.
- You are required to diagonally traverse the upper half of the matrix and print the contents.
Example 1:
Input: n=4,
arr = { 1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16 }
Output: 1 6 11 16 2 7 12 3 8 4
Constraints:
1 <= n <= 10^2
-10^9 <= e11, e12, .. n * m elements <= 10^9