Didn't understand the concept

Can you send some pseudocode or something?

hello @akash_281

here the code snippet for thee same.
image

logic is to fix top left and bottom right coordinate of submatrix .
and then calculate its sum and add it to ur result.