C++ solution | Dynamic programming and Priority Queue
\n\n\nclass Solution {\npublic:\n    int kthLargestValue(vector<vector<int>>& matrix, int k) {\n        priority_queue<int>pq;\n        pq.push(matrix[0][0]);\n
![image](https://assets.leetcode.com/users/images/e7565ffb-18fa-4e19-9a6b-4c17257eb0da_1655624611.776394.jpeg)\n\n```\nclass Solution {\npublic:\n    int kthLargestValue(vector<vector<int>>& matrix, int k) {\n        priority_queue<int>pq;\n        pq.push(matrix[0][0]);\n        for(int j=1;j<matrix[0].size();j++){\n            matrix[0][j]^=matrix[0][j-1];\n            pq.push(matrix[0][j]);\n        }\n        for(int i=1;i<matrix.size();i++){\n            matrix[i][0]^=matrix[i-1][0];\n            pq.push(matrix[i][0]);\n        }\n        for(int i=1;i<matrix.size();i++){\n            for(int j=1;j<matrix[i].size();j++){\n                matrix[i][j]^=matrix[i-1][j]^matrix[i][j-1]^matrix[i-1][j-1];\n                pq.push(matrix[i][j]);\n            }\n        }\n        while(--k>0){\n            pq.pop();\n        }\n        return pq.top();\n    }\n};\n```
['Dynamic Programming', 'Bit Manipulation', 'C', 'Heap (Priority Queue)', 'C++']