No of submatrices that sum to target

TLE is coming
quesn link - https://leetcode.com/problems/number-of-submatrices-that-sum-to-target/
my code -
class Solution {
public:
int res=0;
void get_result(vector& nums,int target){
unordered_map<int,int>mp;
int sum=0;
mp.clear();
mp[0]++;
for(auto i:nums){
sum+=i;
res += mp[sum-target];
mp[sum]++;
}

}
int numSubmatrixSumTarget(vector<vector<int>>& A, int target) {
     int  m = A.size(), n = A[0].size();
     vector<int> row(n);
    for(int i=0;i<m;i++){
        fill(row.begin(),row.end(),0);
        for(int j=i;j<m;j++){
            for(int x=0;x<n;x++)
                row[x] +=A[j][x];
            get_result(row,target);
        }
    }
    return res;
}

};

hello @Devanshi_Mittal
please share ur code using cb ide

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.