No. of arrays with xor sum equal to 0

Revision en2, by ajayNegi, 2020-04-14 17:13:18

In a recent hiring challenge, a question was asked to find the no. of arrays of size N, whose xor of all the elements is 0 and the array should only contain 0,1,2,3,4,5 as its element. Return ans%(1e9+7). 1<=N<=1e5

Here are the test cases for the first 60 elements.

How should I approach this problem?

Tags #combinatorics, #permutation, #xor

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ajayNegi 2020-04-14 17:13:18 15 Tiny change: 'of arrays whose xor' -> 'of arrays of **size N**, whose xor'
en1 English ajayNegi 2020-04-14 17:07:14 372 Initial revision (published)