Submatrices sum approach 2 cummulative sum

https://codeshare.io/a36ypL

it is always showing less than expected ouput whats the problem.

@vikanshu2016
hello vikanshu,
pls watch video tutorial again and try to debug ur code. if u still not able to find ur mistake then pls ask

if have tried debugging but failed

@vikanshu2016
I think ur code is correct.

please share the test case where it is failing

it is working for 2x2 matrices but when it comes to 3x3 or more it is showing wrong output and output is always less than the expected outcome.

input:-

arr = 3x3 matrix of all 1
output = 93
expected output = 100

arr = 4x4 matrix of all 1
output = 336
expected output = 400

I have tried running in debug mode but unable to find error and logic is according to the video.

@vikanshu2016
vikanshu, in line no 47 it should be csum_arr but u have written arr .

here is ur updatd code

yeah now its working, thanks

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.

link not working…

@vikanshu2016
yeah it s an issue, team will resolve it soon