You are viewing a single comment's thread. Return to all comments →
C
int diagonalDifference(int arr_rows, int arr_columns, int** arr) { int d1=0; int d2=0; for(int i = 0 ,j = arr_rows-1;i<arr_rows;i++,j--){ d1+=*(*(arr+i)+i); d2+=*(*(arr+i)+j); } return abs(d1-d2); }
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