You are viewing a single comment's thread. Return to all comments →
def diagonalDifference(arr): n = 0 lr = 0 rl = 0 for x in arr: lr += x[n] n+=1 for x in arr: rl += x[n-1] n-=1 return lr - rl if lr - rl > 0 else (lr - rl) * -1
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 →