Diagonal Difference

  • + 0 comments
    # Write your code here
    principal = 0
    secondary = 0
    n = len(arr)
    
    for i in range(0, n):
    		principal+=arr[i][i]
    		secondary+=arr[i][n-i-1]
    
    absDiff = abs(principal-secondary)
    return absDiff
    

    undefined