Diagonal Difference

  • + 0 comments

    Solution TypeScript:

     let result = 0
     for(let i = 0; i< arr.length; i++){
          result+= (arr[i][i] - arr[i][(arr.length - 1) - i])
     }
     return Math.abs(result)