New update is available. Click here to update.

Posted: 3 Feb, 2021

Difficulty: Moderate

```
An array ‘B’ is a subarray of an array ‘A’ if ‘B’ that can be obtained by deletion of, several elements(possibly none) from the start of ‘A’ and several elements(possibly none) from the end of ‘A’.
```

```
The first line contains a single integer ‘T’ denoting the number of test cases. The test cases follow.
The first line of each test case contains two integers ‘N’ and ‘X’ separated by a single space, denoting the number of elements in the array and the required subarray XOR respectively.
The second line of each test case contains ‘N’ single space-separated integers denoting the elements of the array.
```

```
For each test case, print on a new line the number of subarrays of the given array that have bitwise XOR of the elements equal to ‘X’.
Print the output of each test case in a separate line.
```

```
You don’t need to print anything; It has already been taken care of.
```

```
1 <= T <= 10
3 <= N <= 5 * 10 ^ 4
0 <= X <= 10 ^ 9
0 <= ARR[i] <= 10 ^ 9
Where ‘T’ denotes the number of test cases, ‘N’ denotes the number of elements in the array, ‘X’ denotes the required subarray XOR and ARR[i] denotes the 'i-th' element of the given array.
Time Limit: 1 sec
```

SIMILAR PROBLEMS

Longest Subarray With Zero Sum

Posted: 3 Nov, 2022

Difficulty: Moderate

Merge Two Sorted Arrays Without Extra Space

Posted: 19 Nov, 2022

Difficulty: Moderate

Ninja And The Strictly Increasing Array

Posted: 27 Nov, 2022

Difficulty: Moderate

Maximum GCD

Posted: 8 Dec, 2022

Difficulty: Hard

Negative To The End

Posted: 16 Dec, 2022

Difficulty: Easy

Categories:

Popular Courses: