1738. Find Kth Largest XOR Coordinate Value
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int kthLargestValue(int[][] grid, int k) {
        int rows = grid.length;
        int cols = grid[0].length;
        int[] values = new int[rows * cols];
        int[][] prefixXor = new int[rows][cols];
        
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                prefixXor[i][j] = grid[i][j];
                if (i > 0) prefixXor[i][j] ^= prefixXor[i - 1][j];
                if (j > 0) prefixXor[i][j] ^= prefixXor[i][j - 1];
                if (i > 0 && j > 0) prefixXor[i][j] ^= prefixXor[i - 1][j - 1];
                values[i * cols + j] = prefixXor[i][j];
            }
        }
        
        Arrays.sort(values);
        return values[rows * cols - k];
    }
}

```
['Java']