Not able to apply logic


is this logic correct how can we compare maximum in be them
please alter code in this .

@rastogi.g1998 firstly, you need to apply a nested for loop to generate all the possible pairs between x, and y. And calculate their xor, and select the max possible value. But the brute force approach will give you TLE as it has a time complexity of O(n*n) . The concept of bitmasking can be applied here. Please look for the hint video given in the course for this question, you will be able to understand it.

Thank you understood the approach and logic

@rastogi.g1998 please mark the doubt as resolved.