Use Array and basic XOR calculation + sorting
Complexity

Time complexity:
O(M*N)


Space complexity:
O(M*N)

Code
# Complexity
- Time complexity:
O(M*N)

- Space complexity:
O(M*N)

# Code
```cpp []
class Solution {
public:
    int kthLargestValue(vector<vector<int>>& matrix, int k) {
        int m = matrix.size(), n = matrix[0].size();
        vector<int> v(m * n, 0);
        for (int i = 0; i < m; i++) {
            int num = 0;
            for (int j = 0; j < n; j++) {
                if (i == 0) {
                    num ^= matrix[i][j];
                    v[i * n + j] = num;
                } else {
                    num ^= matrix[i][j];
                    v[i * n + j] = v[(i - 1) * n + j] ^ num;
                }
            }
        }
        sort(v.begin(), v.end());

        return v[m * n - k];
    }
};

```
['C++']