You are viewing a single comment's thread. Return to all comments →
Here is a Python 3 solution:
def diagonalDifference(arr: list[list[int]]) -> int: return abs(sum(row[i] - row[~i] for i, row in enumerate(arr)))
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 solution: