You are viewing a single comment's thread. Return to all comments →
My solution is to accumulate the mirrored difference in each row like so:
N = int(input()) total = 0 for i in range(N): row = input().split() total += int(row[i])-int(row[-(i+1)]) print(abs(total))
the only conversions are at two indeces per row regardless of size.
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 solution is to accumulate the mirrored difference in each row like so:
the only conversions are at two indeces per row regardless of size.