SUBMATRIX SUM QUERY


whats wrong in this code

Hello @mohitsharmakosi2001 see line 21
p[i][j]=p[i][j]+p[i-1][j] // it should be this:

https://ide.codingblocks.com/s/440477 here prefix sum matrix((1,1)(2,2)) is coming correct but why not the sum of the given submatrix is coming

@mohitsharmakosi2001 check now:

https://ide.codingblocks.com/s/440477 prefix sum matrix is coming in this also but not the sum of sub matrix having top left(li,lj) and top right(bi,bj)