C++ n-th element
cpp\nint kthLargestValue(vector<vector<int>>& m, int k) {\n    vector<int> vals;\n    for (auto i = 0; i < m.size(); ++i)\n        for (auto j = 0; j < m[i].siz
```cpp\nint kthLargestValue(vector<vector<int>>& m, int k) {\n    vector<int> vals;\n    for (auto i = 0; i < m.size(); ++i)\n        for (auto j = 0; j < m[i].size(); ++j) {\n            m[i][j] ^= (i > 0 ? m[i - 1][j] : 0) ^ (j > 0 ? m[i][j - 1] : 0)\n                ^ (i > 0 && j > 0 ? m[i - 1][j - 1] : 0);\n            vals.push_back(m[i][j]);\n        }\n    nth_element(begin(vals), begin(vals) + k - 1, end(vals), greater<int>()); \n    return vals[k - 1];\n}\n```
[]