You are viewing a single comment's thread. Return to all comments →
Python 3
def diagonalDifference(arr): diag1 = diag2 = i = 0 for row in arr: diag1 += row[i] diag2 += row[-1-i] i += 1 return abs(diag1 - diag2)
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 →
Python 3