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