c++ prefix sum and python numpy solution ✔
c++\n\nclass Solution {\npublic:\n    vector<vector<int>> rangeAddQueries(int n, vector<vector<int>>& q) {\n        vector<vector<int>> temp(n+1,vector<int>(n+1
c++\n```\nclass Solution {\npublic:\n    vector<vector<int>> rangeAddQueries(int n, vector<vector<int>>& q) {\n        vector<vector<int>> temp(n+1,vector<int>(n+1,0));\n        for(auto &x:q){\n            int i1=x[0], j1=x[1], i2=x[2], j2= x[3];\n            //top left and bottom right\n            temp[i1][j1]++;\n            temp[i2+1][j2+1]++;\n            //bottom left and top right\n            temp[i1][j2+1]--;\n            temp[i2+1][j1]--;\n        }\n        \n        vector<vector<int>> ans(n,vector<int>(n,0));\n        for(int i=0;i<n;i++){\n            for(int j=0;j<n;j++){\n                //applying top-down on temp array\n                if(i>0)temp[i][j]+= temp[i-1][j];\n                if(j>0)temp[i][j]+= temp[i][j-1];\n                if(i>0 && j>0) temp[i][j]-= temp[i-1][j-1];\n                \n                ans[i][j]= temp[i][j];\n            }\n        }\n        \n        return ans;\n    }\n};\n```\n\n\npython (using numpy)\n```\nimport numpy\n\nclass Solution:\n    def rangeAddQueries(self, n: int, qq: List[List[int]]) -> List[List[int]]:\n        arr= [[0]* n for i in range(n)];\n        arr= numpy.array(arr);\n        \n        for q in qq:\n            r1,c1,r2,c2= q[0],q[1],q[2],q[3]\n            \n            arr[r1:r2+1, c1:c2+1]+=1\n            \n            \n        return arr\n```
['C', 'Prefix Sum', 'Python', 'C++']