You are viewing a single comment's thread. Return to all comments →
C#
public static int diagonalDifference(List<List<int>> arr, int size) { var lsum = 0; var rsum = 0; for (var xl = 0; xl < size; xl++) { lsum += arr[xl][xl]; rsum += arr[xl][size - 1 - xl]; } return Math.Abs(lsum - rsum); }
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
C#