You are viewing a single comment's thread. Return to all comments →
public static int diagonalDifference(List<List<int>> arr) { int left = 0; int right = 0 ; int indexRight = arr.Count(); for(int x=0; x < arr.Count(); x ++){ indexRight --; left += arr[x][x]; right += arr[x][indexRight]; } if(left > right) return left - right; else return right - left; }
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 →
Solution in C