Range Xor Problem

Although My Code is passing all the test cases But I have used a simple Brute Force approach. Please tell me How I can do this ques with the more efficient approach than I used.
The link of my code is : -

You need to use trie data structure. Please see these 2 links to understand how trie works.


https://www.quora.com/q/threadsiiithyderabad/Tutorial-on-Trie-and-example-problems