You are viewing a single comment's thread. Return to all comments →
Little bit tweaked example from above:
n = int(input()) diagonal1, diagonal2 = 0, 0 for i in range(n): row = input().split() diagonal1 += int(row[i]) diagonal2 += int(row[n-1-i]) print(abs(diagonal1-diagonal2))
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 →
Little bit tweaked example from above: