its not clear from question about what we have to do?
Can you explain the question
hey @Himanshu-Jhawar-2273952536067590
There’ll be certain queries
Each one will be either type 0 or type 1
For type 0: you’ll be given a number, which you’ve to insert at the end of the array and print nothing.
For type 1: You’ll be given a number x and a range l,r… You’ll have to find a number from index l to index r in the array, you’ve to find such a number from index l to index r such that xor of X and that number is maximum
So let me show you through example
5
0 3
0 5
0 10
0 6
1 1 4 6
5 is the no of queries
For the first query , which is 0 type . You’ve to insert 3… So array is 3
For the next three queries… you’ve to add 5, 10, 6… so array becomes 3,5,10,6
So last query…1 1 4 6
L = 1, R = 4, and x is 6
So you’ve to find a number from index 1 to 4 whose xor with x is maximum.
So for index 1 , xor 6 with 3
Index 2, xor 6 with 5
Index 3, xor 6 with 10
Index 4 xor 6 with 6
Maximum of all these xor will be the ans