O(NMlogk) c++ solution || Using min heap
\n\n# Code\n\nclass Solution {\npublic:\n//idea is matrix[i][j]= xor of matrix[i-1][j],matrix[i][j-1],matrix[i-1][j-1]\n    int kthLargestValue(vector<vector<in
\n\n# Code\n```\nclass Solution {\npublic:\n//idea is matrix[i][j]= xor of matrix[i-1][j],matrix[i][j-1],matrix[i-1][j-1]\n    int kthLargestValue(vector<vector<int>>& matrix, int k) {\n        int n = matrix.size(), m = matrix[0].size();\n        priority_queue<int, vector<int>, greater<int>> pq;        \n        for(int i=0;i<n;i++)\n            for(int j=0;j<m;j++){\n                if(i)\n                    matrix[i][j]^=matrix[i-1][j];\n                if(j)\n                    matrix[i][j]^=matrix[i][j-1];\n                if(i && j)\n                    matrix[i][j]^=matrix[i-1][j-1];\n                pq.push(matrix[i][j]);\n                if(pq.size()>k)\n                    pq.pop();\n            }\n        return pq.top();\n    }\n};\n```
['C++']