✔✔C++ ||91% faster ||easy to understand || Have a look  ||explained
\nclass Solution {\npublic:\n\n    // this part you have already solve on leetcode here we are just solving famous leetcode problem number of subarrays with sum
\nclass Solution {\npublic:\n\n    // this part you have already solve on leetcode here we are just solving famous leetcode problem number of subarrays with sum k\n\t// we are just converting this bigger problem into one of the most renowed problem\n\t\t\n\t\tint solve(vector<int>&nums,int k)\n    {unordered_map<int,int>mp;\n     int cs=0;\n     int ans=0;\n     for(int i=0;i<nums.size();++i)\n     {\n         cs+=nums[i];\n         if(cs==k)\n         {\n            ans++; \n         }\n         if(mp.find(cs-k)!=mp.end())\n         {\n             ans+=mp[cs-k];\n          \n         }\n         mp[cs]++;\n     }\n     return ans;\n        \n    }\n    int numSubmatrixSumTarget(vector<vector<int>>& a, int t) {\n         int ans=0;\n        //we will actually work row wise because we already know  the problem to find number of subarray in a row with a given sum\n        for(int srow=0;srow<a.size();++srow)\n        {vector<int>v(a[0].size(),0);\n            for(int crow =srow;crow<a.size();++crow)//crow-->currrow\n            {\n                // now storing sum in  a particular array\n                for(int j=0;j<a[0].size();++j)\n                {\n                    v[j]+=a[crow][j];\n                }\n                ans+=solve(v,t);\n            }\n        }\n        \n        return ans;\n    }\n};\n/*\n**Taking an example**\n**step 1--\nsolving like this\n1 1 1 1->srow v=> 1 1 1 1\n1 1 1 1       v=> 2 2 2 2\n1 1 1 1       v=> 3 3 3 3\n1 1 1 1       v=> 4 4 4 4\nstep 2--\n1 1 1 1 \n1 1 1 1=>srow v=> 1 1 1 1\n1 1 1 1       v=> 2 2 2 2\n1 1 1 1       v=> 3 3 3 3\nstep 3--\n1 1 1 1 \n1 1 1 1\n1 1 1 1  =>srow v=> 1 1 1 1    \n1 1 1 1        v=> 2 2 2 2\nstep 4--\n1 1 1 1 \n1 1 1 1\n1 1 1 1  \n1 1 1 1   =>srow v=> 1 1 1 1    \nevery time  we are calculating the cumulative sum starting from the srow index\nand you will get your ans**\n*/\n**Upvote if it helped**
['C']