You are viewing a single comment's thread. Return to all comments →
Python
def diagonalDifference(arr): ltrSum = 0 rtlSum = 0 cont = 0 for i in range(len(arr)): ltrSum += int(arr[i][i]) for i in range(len(arr)-1, -1, -1): rtlSum += int(arr[cont][i]) cont += 1 return abs(ltrSum - rtlSum)
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 →
Python