CPP BRUTE FORCE O(n^6) time complexity, just for fun, TIME LIMIT EXCEEDS
\nclass Solution {\npublic:\n    \n    int sum(vector<vector<int>>& matrix, int i,int j,int k,int l){\n        int s=0;\n        for(int p=i;p<=k;p++){\n       
```\nclass Solution {\npublic:\n    \n    int sum(vector<vector<int>>& matrix, int i,int j,int k,int l){\n        int s=0;\n        for(int p=i;p<=k;p++){\n            for(int q=j;q<=l;q++){\n                s+=matrix[p][q];\n            }\n        }\n        return s;\n    }\n    int numSubmatrixSumTarget(vector<vector<int>>& matrix, int target) {\n        int c=0;\n        for(int i=0;i<matrix.size();i++){\n            for(int j=0;j<matrix[i].size();j++){\n                for(int k=i;k<matrix.size();k++){\n                    for(int l=j;l<matrix[k].size();l++){\n                        if(sum(matrix,i,j,k,l)==target)\n                            c++;\n                    }\n                }\n            }\n        }\n        return c;\n    }\n};\n```
[]