2-d prefix xor easy solution
class Solution {\npublic:\n    int kthLargestValue(vector>& v, int k) {\n      \n        int m=v.size();\n        int n=v[0].size();\n          vector>vis(m,vec
class Solution {\npublic:\n    int kthLargestValue(vector<vector<int>>& v, int k) {\n      \n        int m=v.size();\n        int n=v[0].size();\n          vector<vector<int>>vis(m,vector<int>(n,0));\n        vector<int>res;\n        for(int i=0;i<m;i++)\n        {\n            for(int j=0;j<n;j++)\n            {\n                if(i==0&&j==0)\n                   {\n                    vis[i][j]=v[i][j];\n                    res.push_back(vis[i][j]);\n                    continue;\n                    }\n                else if(i==0&&j!=0)\n                {\n                    vis[i][j]=v[i][j]^vis[i][j-1];\n                    res.push_back(vis[i][j]);\n                }\n                else if(j==0&&i!=0)\n                {\n                    vis[i][j]=v[i][j]^vis[i-1][j];\n                   res.push_back(vis[i][j]);\n                }\n                else if(i>0&&j>0)\n                {\n                    vis[i][j]=v[i][j]^vis[i-1][j]^vis[i][j-1]^vis[i-1][j-1];\n                    res.push_back(vis[i][j]);\n                }\n                \n            }\n        }\n        sort(res.begin(),res.end());\n        reverse(res.begin(),res.end());\n        //return res.size();\n        return res[k-1];\n        //return vis[1][1];\n    }\n};
['Dynamic Programming']