EASY UNDERSTAND C++ SOLUTION
\nclass Solution {\npublic:\n    vector<vector<int>> rangeAddQueries(int n, vector<vector<int>>& queries) {\n        vector<int> v(n*n+1);\n        int x,y,z,k;
```\nclass Solution {\npublic:\n    vector<vector<int>> rangeAddQueries(int n, vector<vector<int>>& queries) {\n        vector<int> v(n*n+1);\n        int x,y,z,k;\n        for(auto &i: queries){\n            z = i[2]-i[0]+1;\n            k = 0;\n            while(z--){\n            x = (i[0]+k)*n+i[1],y = (i[0]+k)*n+i[3]+1;\n                k++;\n            v[x]++;v[y]--;\n            }\n        }\n        for(int i = 1; i<= n*n; i++){\n            v[i] = v[i-1]+v[i];\n        }\n        vector<vector<int>> ans(n,vector<int>(n));\n        for(x = 0; x < n; x++){\n            for(y = 0; y < n; y++){\n                ans[x][y] = v[x*n+y];\n            }\n        }\n        return ans;\n    }\n};```
['Array', 'Dynamic Programming', 'C', 'Matrix', 'Prefix Sum', 'C++']