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