➽ Problem:-
https://www.hackerrank.com/challenges/diagonal-difference/problem
➽ Solution:-
import math
import os
import
random
import re
import sys
num =
int(input())
LDS = 0
RDS = 0
for i in
range(num):
arr = list(map(int,input().split()))
LDS += arr[i]
RDS += arr[num-1-i]
print(abs(LDS
- RDS))
0 Comments
Please do not enter any spam link in the comment section.