this is the link for my code
Wrong output in the program for sum of of all submatrices using prefix sum method
Hello @mansi_sharma9kF,
The junk values are getting added and subtracted from the sum for the cases:
- When li=0
- when lj=0
You have to check for these cases before computing the sum.
Modified Code:
Hope, this would help.
Give a like if you are satisfied.
1 Like