My approach was that I formed a prefix or array and find the maximum xor pair (let’s say pair1), and their indexes. now for second xor pair, it can lie either left of the pair1 or right of the pair1.
so I formed a separate trie for indexes left of pair1 and for indexes right of pair1.
I think it can be optimized, I am unable to think the different approach and is my approach even correct?