Diagonal Difference

  • + 0 comments

    def diagonalDifference(arr): Sum1=0 for i in range(len(arr)): Sum1 += arr[i][i] Sum2=0 for i in range(len(arr)): Sum2 += arr[i][n-i-1] return abs(Sum1-Sum2)