Showing:
Handle Score
@Ibrahim Nash 6420
@mb1973 5578
@Quandray 5231
@akhayrutdinov 5111
@saiujwal13083 4510
@sanjay05 3762
@kirtidee18 3673
@marius_valentin_dragoi 3522
@sushant_a 3459
@verma_ji 3412
Split the Array
Easy Accuracy: 10.1% Submissions: 89 Points: 2

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.
Note: The answer could be very large so print it by doing modulos with 109 + 7.

Example 1:

Input : a[] = {1, 2, 3}
Output : 3
Explanation:
{(1),(2, 3)},{(2),(1, 3)},{(3),(1, 2)}
are three ways with equal XOR
value of two groups.



Example 2:

Input : a[] = {5, 2, 3, 2}
Output : 0



The input is already taken care of by the driver code. You only need to complete the function countgroup() that takes an array (a), sizeOfArray (n), and return the number of ways to split an array. The driver code takes care of the printing.

Expected Time Complexity: O(N).
Expected Auxiliary Space: O(1).

Constraints:

1<=N<=105
1<=a<=108