Answers for "diagonal difference hackerrank solution in py"

0

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))
Posted by: Guest on March-24-2021

Code answers related to "diagonal difference hackerrank solution in py"

Python Answers by Framework

Browse Popular Code Answers by Language