So I have task where I have to check if there are multiple 1s on any diagonal of a 8x8 matrix.
For example if this is the matrix:
0 0 0 0 0 1 0 0
0 0 0 1 0 0 0 0
0 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0
0 0 0 0 1 0 0 0
0 0 1 0 0 0 0 0
Output should be "No", because there isn't a diagonal with multiple 1s.
But for this:
0 0 0 0 0 1 0 0
0 0 0 1 0 0 0 0
0 0 1 0 0 0 1 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0
0 0 0 0 1 0 1 0
0 0 1 0 0 0 0 0
output should be "Yes" since it has two number 1 in one diagonal. I can't quite figure out how to make it check diagonal.