Submatrix sum query

i wrote this code for sub matrix sum query problem. i do not know what have i doing wrong? please somebody help me .
the link of that code is here -

Logic is correct
i have done one change you can see it in modified
Code

Modified code

if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like :heart:: and don’t forgot to mark doubt as resolved :grinning:

1 Like

@asaurabh_26 ok sir now it is working well. I understood what i was doing wrong. Thank u so much
:grinning: :smiley: :smile: