You are viewing a single comment's thread. Return to all comments →
Python solution
def diagonalDifference(arr): d1 = d2 = 0 for i in range(0, len(arr)): d1 += arr[i][i] d2 += arr[i][len(arr) - i - 1] return abs(d1 - d2)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
Python solution