from given test case, i.e. 3, 2, 3, 5, 6,5, 2
ans = 0;
1st run : 0^3 = 3;
2nd run: 3^2 = 1;
3rd run: 1^3 = 2;
4th run: 2^5 = 7;
5th run: 7^6 = 1;
6th run: 1^5 = 4;
7th run: 4^2 = 6;
In the end, we came to the resultant answer, I get that. But I don’t understand why is if intermediate ans are different and it doesn’t even know if the previous number was repeated.
Suppose there are 6 digits only, the output is outside the input given, the output is XOR of remaining two unique numbers.
I am unable to understand the logic beyond two same numbers give 0 as output for their XOR.