Problem statement: FRNDZND

There are some things you should know about xor:

a ^ a = 0

a ^ a ^ a ^ a .. even number of times = 0

a ^ a ^ a… odd number of times = a

L and R will give you a continuous segment of the array and you have to find all possible subsets. Suppose the elements in the contiguous segments are a and b.

Subsets: {} , {a}, {b}, {a,b}

so result = (a) ^ (b) ^ (a^b)

In the above expression a occurs even number of times and so does b so the result is zero. This can be extended for contiguous segments of length > 2 also.

So the only queries for which the result wont be zero are segments of length 1 i.e. when l=r and the answer is array[l].