hackerrank diagonal difference solution code example
Example: diagonal difference hackerrank solution in python
def diagonalDifference(arr):
# Write your code here
d1 = sum([arr[x][x] for x in range(len(arr))])
d2 = sum([arr[x][n - 1 - x] for x in range(len(arr))])
return(abs(d1 - d2))