You are viewing a single comment's thread. Return to all comments →
one liner python
print(abs(sum((lambda arr: int(arr[x]) - int(arr[len(arr) - x - 1]))(input().split()) for x in range(int(input())))))
other approach
n = int(input().strip()) result = 0 for x in range(n): arr = input().strip().split() result += int(arr[x]) - int(arr[n - x - 1]) print(abs(result))
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
one liner python
other approach