Kth Largest XOR Coordinate

For each coordinate (a, b) in a 2D matrix, define its XOR coordinate value as the XOR of all elements in the rectangle from (0, 0) to (a, b). Collect these values for all coordinates and find the k-th largest among them.

Examples
Input: [[[5,2],[1,6]],1]
Output: 7
Hints

Kth Largest XOR Coordinate

For each coordinate `(a, b)` in a 2D matrix, define its XOR coordinate value as the XOR of all elements in the rectangle from `(0, 0)` to `(a, b)`. Collect these values for all coordinates and find the `k`-th largest among them.