## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] The Subarray XOR CodeChef Solution

Given an array $A$ having $N$ elements, a subarray $S$ of $A$ is called good if $XOR\left(S\right)\ge K$, where $XOR\left(S\right)$ denotes the bitwise XOR of all the elements of the subarray $S$.
Find the length of the smallest subarray $S$ which is good. If there is no good subarray, print $-1$ instead.

### Input Format

• The first line of input contains a single integer $T$, denoting the number of test cases. The description of the $T$ test cases follows.
• The first line of each test case contains two space-separated integers $N$ and $K$ - as described in the problem statement.
Solution Click Below:-  👉
👇👇👇👇👇

• The second line of each test case contains $N$ space-separated integers ${A}_{1},{A}_{2},...,{A}_{N}$${A}_{i}$ representing the elements of the array $A$.

### Output Format

For each test case, output in a single line, the length of the shortest subarray which is good. If there

Fitness CodeChef Solution

Complementary Strand in a DNA CodeChef Solution

Make all equal using Pairs Codechef Solution

Count the ACs CodeChef Solution

Strong Elements CodeChef Solution

Reversal Sorting CodeChef Solution

AP Grid CodeChef Solution

Gcd and Lcm CodeChef Solution

The Subarray XOR CodeChef Solution

is no good subarray, print $-1$.

### Constraints

• $1\le T\le 2\cdot {10}^{4}$
• $1\le N\le {10}^{5}$
• $0\le {A}_{i}<{2}^{30}$
• $0\le K<{2}^{31}$
• Sum of $N$ over all test cases does not exceed $2\cdot {10}^{5}$.