You are viewing a single comment's thread. Return to all comments →
**My Shortest Python Solution **
def diagonalDifference(arr): L = R = 0 n = len(arr[0]) for i in range(n): L += arr[i][i] R += arr[i][n-1-i ] return abs(L-R) or else : def diagonalDifference(n,arr): L = R = 0 for i in range(n): L += arr[i][i] R += arr[i][n-1-i ] return abs(L-R) result = diagonalDifference(n,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 →
**My Shortest Python Solution **