Diagonal Difference

  • + 0 comments
    def diagonalDifference(arr)
        result = 0
        count = len(arr)
        for i in range(count):
            result += arr[i][i]
            result -= arr[count - 1 - i][i]
        return abs(result)