check for this test case also
1
6
3 3 2 2 5 6
Your Ans : Second
Correct Ans : First(According to accepted solution…here is solution link …
https://www.codechef.com/viewsolution/9711632
)
Happy coding
check for this test case also
1
6
3 3 2 2 5 6
Your Ans : Second
Correct Ans : First(According to accepted solution…here is solution link …
https://www.codechef.com/viewsolution/9711632
)
Happy coding
Someone please clear my doubt by giving a test case.I didn’t checked the first condition of xoring all elements and checking if its zero…directly checked if N is odd or even.Because I feel that there is no way of getting xor=0 if N is odd.Someone please prove me wrong!
I got it…1 2 3 is the case I was looking for!
What will the output when the input is :
1
4
2 2 1 3
In this case, the correct answer should be Second.
But above stated method gives First.
@ashubaplawat there are many ways for the first to win , one of them is : (1,1,2,2,3,4) -> (1,1,2,2,3)
-> (1,1,2,3) -> (1,1,3) -> (1,3) -> 1 -> 3