You are viewing a single comment's thread. Return to all comments →
c++
int diagonalDifference(vector<vector<int>> arr) { int result = 0; for(int i = 0; i < arr.size(); ++i){ vector<int> const& row = arr[i]; result += row[i] - row[row.size() - i - 1]; } return std::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 →
c++