You are viewing a single comment's thread. Return to all comments →
def diagonalDifference(arr): x = 0 y = 0 for i in range(n): x += arr[i][i] y += arr[i][-(1+i)] return abs(x-y)
at least this works lol i dont do coding
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 →
def diagonalDifference(arr): x = 0 y = 0 for i in range(n): x += arr[i][i] y += arr[i][-(1+i)] return abs(x-y)
at least this works lol i dont do coding