C++ priority_queue
\nclass Solution {\npublic:\nint kthLargestValue(vector<vector<int>>& matrix, int k)\n{\n\tpriority_queue<int, vector<int>, greater<int>> q;\n\tq.push(matrix[0]
```\nclass Solution {\npublic:\nint kthLargestValue(vector<vector<int>>& matrix, int k)\n{\n\tpriority_queue<int, vector<int>, greater<int>> q;\n\tq.push(matrix[0][0]);\n\tfor (int i = 1; i < matrix.size(); i++) {\n\t\tmatrix[i][0] ^= matrix[i - 1][0];\n\t\tq.push(matrix[i][0]);\n\t\tif (q.size() > k)\n\t\t\tq.pop();\n\t}\n\n\tfor (int i = 1; i < matrix[0].size(); i++)\n\t{\n\t\tmatrix[0][i] ^= matrix[0][i - 1];\n\t\tq.push(matrix[0][i]);\n\t\tif (q.size() > k)\n\t\t\tq.pop();\n\t}\n\n\tfor (int i = 1; i < matrix.size(); i++)\n\t{\n\t\tfor (int j = 1; j < matrix[i].size(); j++)\n\t\t{\n\t\t\tmatrix[i][j] ^= (matrix[i - 1][j] ^ matrix[i][j - 1] ^ matrix[i - 1][j - 1]);\n\t\t\tq.push(matrix[i][j]);\n\t\t\tif (q.size() > k)\n\t\t\t\tq.pop();\n\t\t}\n\t}\n\n\treturn q.top();\n}\n};\n```
[]