First Move In A Nim Game
Two players Alice and Bob are playing NIM Game with each other. Both are playing optimally.Alice starts the game. The task is to find the number of ways of playing 1st move for Alice to ensure a winning strategy for him if possible, otherwise print -1.
1<= n <= 10^5 1<= A[i] <= 10^8
The first line contains one integer n. The second line contains n space separated integers a,a...a[n].
Print the number of possible first move for Alice to win. If Alice can't win, Print -1.
7 24 6 10 56 9 1 24