Submatrix Sum(LintCode 405):

Problem