You are viewing a single comment's thread. Return to all comments →
For a more readable format:
int squareDiffHalf(vector<vector<int>> matrix, int n) { int diff = 0; for (int i = 0; i < n/2; i++) { diff += (matrix[i][i] + matrix[n-i-1][n-i-1] - matrix[i][n-i-1] - matrix[n-i-1][i]); } return abs(diff); }
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 →
For a more readable format: