You are viewing a single comment's thread. Return to all comments →
def diagonalDifference(arr): a, b = [], [] [a.append(arr[i][i]) for i in range(n)] [b.append(arr[i][-i-1]) for i in range(n)] return abs(sum(a) - sum(b))
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 →