sir here is my code
i am still getting wrong answer for
2
1 1
1 1
here sum should be 16 but its showing 4 why???
sir here is my code
i am still getting wrong answer for
2
1 1
1 1
here sum should be 16 but its showing 4 why???
According to the brute force solution as mentioned in the video, 1 x 1 matrix is not included.
To include that you just have to modify the loops for bottom right coordinates. Just begin these loops from top left coordinate values.
for(int bi=li+1;bi<n;bi++){
for(int bj=lj+1;bj<n;bj++){
These must start from li and lj.