Hello TA
Please explain the approach that is implemented in that Editorial Code
Thank You
Please Explain the Editorial
@hargovind
The question says that there are 2 types of queries. Type 0 and type 1. In 0, you just have to add given element to array. In 1, you are given 3 numbers L, R and X. You have to find a number (N) from the array between the given indices L and R, so that you get the maximum possible value of XOR for X^N. To maximize XOR, your logic will involve ensuring that the corresponding bits of both these numbers are complementary wherever possible. This is because 0^1 and 1^0 is 1. If the corresponding bits are same, 0^0 and 1^1 is 0, so you will not be able to maximize the XOR value.