Give a N*N square matrix, return an array of its anti-diagonals. Look at the example for more details.
If the matrix is
1 2 3
4 5 6
7 8 9
The output should Return the following :
[3, 5, 7],
i.e print the elements of array diagonally.
Note: The input array given is in single line and you have to output the answer in one line only.
The first line contains an integer T, depicting total number of test cases.
Then following T lines contains an integer N depicting the size of square matrix and next line followed by the value of array.
Print the elements of matrix diagonally in separate line.
1 ≤ T ≤ 30
1 ≤ N ≤ 20
0 ≤ A[i][j] ≤ 9
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.