Regarding the problem statement

Sir I have a couple of doubts in problem statement.

  1. Where are we using the array?
  2. The number in the range 4-6 was asked in the given example so how the answer is 10?

you have to visualize the array
initially array is empty

now if query of type 0 came you have to insert element into array

after these querys
0 3
0 5
0 10
0 6
array will be [3,5,10,6]

now query type 1 came
1 1 4 6
you have to take array portion from 1 to 4 and take xor with 6
whose xor is max is the ans
3^6 = 5
5^6 = 3
10^6 = 12
6^6 = 0

max ans is 12 for 10 so ans is 10

Oh last element is x in query 1, I thought it is R. Thanks, trying.

The l and r given are the index for the array? If yes, then why is it given 4, it will be out of the index

not 0 zero based index
but 1 based index

r=4 then it means 4th element === 3rd index

Okay, got it sir. thank you.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.