Toeplitz Matrix in java

Toeplitz matrix where all the diagonals are equal.



Input:
4
5
6 7 8 9 2
4 6 7 8 9
1 4 6 7 8
0 1 4 6 7

Output:  1

Input:
3
3
1 2 3
4 5 6
7 8 9
 Output: -1



Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Profit and Loss