You are viewing a single comment's thread. Return to all comments →
int diagonalDifference(vector<vector<int>> arr) { int l = 0, r = arr.size() - 1; int result = 0; while(r >= 0 and l < arr.size()) { result = result + arr[l][l] - arr[l][r]; l++; r--; } return abs(result); }
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 →