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