C++
\nclass Solution {\npublic:\n    int kthLargestValue(vector<vector<int>>& m, int k) {\n        vector<vector<int>> v(m.size(), vector<int>(m[0].size()));\n     
```\nclass Solution {\npublic:\n    int kthLargestValue(vector<vector<int>>& m, int k) {\n        vector<vector<int>> v(m.size(), vector<int>(m[0].size()));\n        for (int i = 0; i < m.size(); ++i){\n            for (int y = 0; y < m[0].size(); ++y){\n                int top = i ? v[i - 1][y]: 0,\n                left = y ? v[i][y - 1] : 0,\n                topLeft = i && y ? v[i - 1][y - 1] : 0;\n                v[i][y] = ((m[i][y] ^ top) ^ left) ^ topLeft;\n            }   \n        }\n        // alternatively use a min heap of size k\n        priority_queue<int> q;\n        for (auto& vec : v)\n            for (auto& n : vec) q.push(n);\n        while (--k) q.pop();\n        return q.top();\n    }\n};\n```
[]