Brute approach for submatrix sum

shoulnot the iteration for finding bottom right start from li and not li+1 because single element rectangle otherwise would not be included?

Hello @Vibhuti0206,
Yeah it should be start from li if we consider single element as rectangle.

Hello @Vibhuti0206,
check out this code - https://ide.codingblocks.com/s/174552 .
I have prepared this for you . it will clear your both doubt.
i.e
a) how to pass 2d matrix
b) whether bottom right start from li+1 or li

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.