Whats wrong with this code?

I have implemented the sub matrix sum query,no errors but its not giving the output,plz check this once…

@aatish08
hello Aatish,
check this part of ur code

here when i and j will start from zero. in that case i-1 will be -1 and j-1 will be -1 so u will be accessing prev[-1][-1] which is wrong.

I did the correction but its throwing run time error now

@aatish08
pls send ur updated code and the problem link


Its working now thanks for the help

@aatish08
cool ,pls dont forget to mark it resolve

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.