You are viewing a single comment's thread. Return to all comments →
C++ int diagonalDifference(vector> arr) { int ltr = 0; int rtl = 0; int len = arr.size();
for (int i = 0; i<len; i++){ ltr += arr[i][i]; rtl += arr[i][len-1-i]; } std::cout<<std::abs(ltr - rtl)<<std::endl; return std::abs(ltr - rtl);
} `
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++ int diagonalDifference(vector> arr) { int ltr = 0; int rtl = 0; int len = arr.size();
} `