Zero Xor
Practice
5 (4 votes)
Algorithms
Arrays
Binary search
Medium
Meet in the middle
Searching
Problem
76% Success 5898 Attempts 30 Points 5s Time Limit 256MB Memory 1024 KB Max Code

A Zero Xor Subset is a non-empty subset having Xor of all the elements in it equal to 0.
Now you are given an array of N numbers.
You have to count the number of different Zero Xor Subsets of this array.

Input:
First line contains a number N
N is the length of the array.
Second line contains the N elements of the array.

Output:
Single number denoting the Count of Zero Xor Subsets of the given array.

Input Constraints:
1<=N<=40
1<=a[i]<=1018

Hint:

Meet in the middle

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
164 votes
Tags:
ApprovedBinary SearchMediumOpenSorting
Points:30
9 votes
Tags:
AlgorithmsBinary SearchMediumOpenSorting
Points:30
12 votes
Tags:
ImplementationAlgorithmsBasics of ImplementationBinary SearchMath