Given an array arr[] of N integers and a integer K, find the number of subsets of arr[] having XOR of elements as K.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. The first line of each test case contains two space separated integers N and K as described in the problem statement. Second line of each test case contains N space separated integers denoting the array arr[].

**Output:**

Corresponding to each test case, print a single line containing an integer denoting the total number of subsets of arr[] having XOR of thier elements as K.

**Constraints:**

1<=T<=10

1<=N<=20

1<=K<=100

0<=arr[i]<=100

**Example:**

**Input:**

1

4 6

6 9 4 2

**Output:**

2

**Explanation:**

The subsets are {4,2} and {6}

Author: pra1nay7_313

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

saiujwal13083 | 347 |

isiddhisingh | 252 |

Abhishek_Jadhav | 243 |

_uncle_sam_ | 221 |

c_ocoooo | 217 |

saiujwal13083 | 610 |

SumitSingh27 | 466 |

c_ocoooo | 456 |

rathiarpit29 | 379 |

NaveenKumarNakka | 370 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4931 |

Quandray | 4598 |

Login to report an issue on this page.