Can you send some pseudocode or something?
Didn't understand the concept
hello @akash_281
here the code snippet for thee same.

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