C++ || Column and Row prefix sum
\nclass Solution {\npublic:\n    int size;\n    void update(int a,int b,int x,int y,vector<vector<int>> &mat){\n        mat[a][b] += 1;\n        if(x+1<size){\n
```\nclass Solution {\npublic:\n    int size;\n    void update(int a,int b,int x,int y,vector<vector<int>> &mat){\n        mat[a][b] += 1;\n        if(x+1<size){\n            mat[x+1][b] -= 1;\n        }\n        if(x+1 < size && y+1 < size){\n            mat[x+1][y+1] += 1;\n        }\n        if(y+1 < size){\n            mat[a][y+1] -= 1;\n        }\n    }\n    \n    vector<vector<int>> rangeAddQueries(int n, vector<vector<int>>& queries) {\n        vector<vector<int>> mat(n,vector<int>(n,0));\n        size = n;\n        for(auto i : queries){\n            update(i[0],i[1],i[2],i[3],mat);\n        }\n        // column prefix sum\n        for(int i=0;i<size;i++){\n            for(int j=1;j<size;j++){\n                mat[i][j] += mat[i][j-1];\n            }\n        }\n        // row prefix sum\n        for(int i=0;i<size;i++){\n            for(int j=1;j<size;j++){\n                mat[j][i] += mat[j-1][i];\n            }\n        }\n        return mat;\n    }\n};\n```
['C', 'Prefix Sum', 'C++']