Hii , I was going to the editorial solution of this question and I think there's something wrong there

For maximising XOR value, we try to go for opposite bits, and then only we are able to add Math.pow(2,j) to our current_Xor , right? But in the editorial when our bit was 1, we should add Math.pow(2,j) in left bit case right??

Lets discuss the test case

5
0 3
0 5
0 10
0 6
1 1 4 6

Here 5 queries will be there and initially our array is empty
in frst 4 queries of type 0 we push into array
[3 5 10 6]
Then for last query of type 1 we get L=1,R=4 ,X=6
Now from the array we need to find a[i] in { a[L],a[L+1],…,a[R] } which gives max xor with X
Here { a[L],a[L+1],…,a[R] } == {a[1],a[2],a[3],a[4]} =={3,5,10,6}
and 3^6=5 , 5^6=3 ,10^6 =12 ,6^6=0
So 10 gives maximum xor so we print 10

There can be multiple queries of both the type and can be mixed like 0,0,0,1,0,1,0,0,0,1 … so on