Check if a 2D array is symmetrical about the main diagonal. Main diagonal — one that goes from the upper left corner of the two-dimensional array to the lower right.
Input: The program takes as input N <= 15, which is the number of rows and columns in the array. Next in the input stream are n lines of N numbers, which are elements of the array.
Output: The program should output the word yes for a symmetrical array and the word no for asymmetric array.
Examples
# |
Input |
Output |
1 |
3
0 1 2
1 2 3
2 3 4
| yes |
2 |
3
0 1 2
1 8 3
2 4 9
| no |