Geeksforgeeks

Error

×

Leaderboard

Showing:

Handle | Score |
---|---|

@Ibrahim Nash | 5761 |

@blackshadows | 5715 |

@akhayrutdinov | 5111 |

@mb1973 | 4989 |

@Quandray | 4944 |

@saiujwal13083 | 4506 |

@sanjay05 | 3762 |

@marius_valentin_dragoi | 3516 |

@sushant_a | 3459 |

@verma_ji | 3341 |

@KshamaGupta | 3318 |

Complete Leaderboard | |

Handle | Score |

@aroranayan999 | 1115 |

@bt8816103042 | 739 |

@thealchemist627 | 456 |

@dalwainazism125 | 453 |

@akashkale117 | 453 |

@shivanandp12345678910 | 453 |

@codeantik | 448 |

@SherlockHolmes3 | 447 |

@SHOAIBVIJAPURE | 430 |

@shalinibhataniya1097 | 408 |

@ShamaKhan1 | 392 |

Complete Leaderboard |

Given an array **A** of **n** integers, the task is to count the number of ways to split given array elements into two disjoint groups such that XOR of elements of each group is equal.

**Input:**

The first line of the input contains a single integer **T**, denoting the number of test cases. Then **T** test cases follow. Each test-case has two lines of the input, the first line contains an integer denoting the size of an array N and the second line of input contains N positive integers .

**Output:**

For each testcase, print no. of ways to split an array in a separate line.

**Constraints:**

1<=T<=100

1<=N<=100

1<=arr<=100

**Example:**

**Input:**

2

3

1 2 3

4

5 2 3 2

**Output:**

3

0

Explanation:

Testcase 1: {(1), (2, 3)}, {(2), (1, 3)}, {(3), (1, 2)} are three ways with equal XOR value of two

groups.

Testcase 2: Not possible

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes
Split the Array

...