Time complexity o(n2)

in the question XOR profit problem my time complexity is O(n2) is there any efficient way to solve this?

@pradyumn25jain yes you are write constraints are small to make sure n*n works.
well there is a way for optimizing here refer this
(https://www.geeksforgeeks.org/maximum-xor-value-of-a-pair-from-a-range/)
dont forget to hit like and mark resolved if cleared :smiley:

ohh alright , thank u so much : - )

@pradyumn25jain you are welcome