Company: Arista
Difficulty: medium
K-th Largest Subarray XOR Sum Given an array of `n` integers, consider the bitwise XOR of every non-empty contiguous subarray. Return the `k`-th largest value among those XOR sums. Equal values are counted separately. Input Format The first line contains `n` and `k`. The second line contains `n` integers `nums[0], nums[1], ..., nums[n-1]`. Output Format Print the `k`-th largest subarray XOR sum. Constraints `1 <= n <= 100000`, `1 <= nums[i] <= 10^9`, and `1 <= k <= n * (n + 1) / 2`. Notes A subarray is contiguous. If several subarrays have the same XOR sum, each one occupies a separate position in the descending order. Example Input ```text 3 2 1 2 3 ``` Output ```text 3 ``` The subarray XOR sums are `1, 3, 0, 2, 1, 3`; sorted descending, they are `3, 3, 2, 1, 1, 0`.