TOOXOR - Editorial

https://www.codechef.com/viewsolution/48073510
Can somebody help me out to find the testcase were it is failing

Consider case-

1
3
0 0 1

if n = 3
array is : 1 2 3
answer is -1
but if i choose i = 1, j = 3, k = 2. so arr[k] = arr[i] ^ arr[j]
array become : 1 (1^3) 3
again i choose i = 1, j = 3, k = 2. so arr[k] = arr[i] ^ arr[j]
array become 1 (1^3^1^3) 3 = 1 0 3
and i choose i = 2, j = 3, k = 1. so arr[k] = arr[i] ^ arr[j]
array become 3 0 3.
This is a good array So why the output is -1 for this.
Please Correct me if I wrongly understand the problem.???

Operation is A_k=A_i\oplus A_j you’ve done A_k=A_k \oplus A_i \oplus A_j

2 Likes

yeah I forget😅 thanks for the clarification

Can anyone tell what is the mistake in my code.

Can you post the link instead?

Yup ,too many edge cases to handle in a short contest … Could have appeared in long

ok

Consider case-

1
3
0 0 1

after considering this case still answer is wrong

Your new solution fails for this-

1
3
1 1 1

I’ll add more in some time.

Edit:
Consider this as well

1
4
0 0 0 1