You are viewing a single comment's thread. Return to all comments →
Here is a python 3 version below:
n = int(input().strip()) dSumLeft = 0 dSumRight = 0 for i in range(n): matrixRow = list(map(int,input().strip().split(' '))) dSumLeft += int(matrixRow[i]) dSumRight += int(matrixRow[n-i-1]) print(abs(dSumLeft - dSumRight))
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
Here is a python 3 version below: