# Need help with INTXOR December Challenge

Here is how I approached to the problem -
I found out that we can divide our arrays in lengths of 4,5 and 7 i.e when (N%4=0), (N%4=1),(N%4=2)(2 parts of length 5 each) and (N%4=3) respectively. Now I will ask my queries in the cyclic manner.
For eg - if part length = 4,then my queries will be
1 2 3 = a
2 3 4 = b
3 4 1 = c
4 1 2 = d
Here a,b,c,d are the answers of the queries. Now we can easily find the values of these 4 indices . For eg- A = a^c^d, A = a^b^d and so on…

if length = 7, queries will be

1 2 3 = a
2 3 4 = b
3 4 5 = c
4 5 6 = d
5 6 7 = e
6 7 1 = f
7 1 2 = g

Here, a = a^c^d^f^g , a = b^d^e^g^a, a = c^e^f^a^b and so on in the cyclic manner…

if length = 5, queries will be
1 2 3 = a
2 3 4 = b
3 4 5 = c
4 5 1 = d
5 1 2 = e

Solving this part is somewhat tricky. But we can solve by first finding a single element and then using it to find the other elements. For eg - to find a we can find it by using -
a^c.
This gives me the answer of 1^2^4^5. Therefore, my a = a^b^c^d^e^a^c which is technically, b^d^e.
Now we can xor this answer we calculated for a with c to get 4^5. Now, using this we can find a because of the reversal property of xor and similarly we can find all the other elements.

However, I don’t know why all my TestCases weren’t accepted on submission. Kindly look into my code and please help if you find any fault in the logic or code. Thankyou Here is my code