Simple C++ code
\n# Code\n\nclass Solution {\npublic:\n    int kthLargestValue(vector<vector<int>>& matrix, int k) {\n        int m = matrix.size();\n        int n = matrix[0].
\n# Code\n```\nclass Solution {\npublic:\n    int kthLargestValue(vector<vector<int>>& matrix, int k) {\n        int m = matrix.size();\n        int n = matrix[0].size();\n        \n        vector<int> ans;\n        for (int i = 0; i < m; i++) {\n            for (int j = 0; j < n; j++) {\n                if (i) matrix[i][j] ^= matrix[i-1][j];\n                if (j) matrix[i][j] ^= matrix[i][j-1];\n                if (i && j) matrix[i][j] ^= matrix[i-1][j-1];\n                ans.push_back(matrix[i][j]);\n            }\n        }\n        \n        sort(ans.begin(), ans.end());\n        return ans[ans.size()-k];\n    }\n};\n```\nCan also use a pq.\n```\nclass Solution {\npublic:\n    int kthLargestValue(vector<vector<int>>& matrix, int k) {\n        int m = matrix.size();\n        int n = matrix[0].size();\n        priority_queue<int, vector<int>, greater<int>> pq; \n        \n        for (int i = 0; i < m; i++) {\n            for (int j = 0; j < n; j++) {\n                if (i) matrix[i][j] ^= matrix[i-1][j];\n                if (j) matrix[i][j] ^= matrix[i][j-1];\n                if (i && j) matrix[i][j] ^= matrix[i-1][j-1];\n                pq.push(matrix[i][j]);\n                if (pq.size() > k) pq.pop(); \n            }\n        }\n        \n        return pq.top();\n    }\n};\n\n```
['C++']