We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The 4 matrix cells listed below are to be checked for the max value possible at arr[i][j] location. We can add the max value obtained at every step and then return their sum. Try out the below written 4 matrix cells to figure out the pattern:-
Flipping the Matrix
You are viewing a single comment's thread. Return to all comments →
The 4 matrix cells listed below are to be checked for the max value possible at arr[i][j] location. We can add the max value obtained at every step and then return their sum. Try out the below written 4 matrix cells to figure out the pattern:-
arr[i][j], arr[i][2*n-j-1], arr[2*n-i-1][j], arr[2*n-i-1][2*n-j-1]