C++ Small and Effective Code
\nclass Solution {\npublic:\n    int findMaximumXOR(vector<int>& arr) {\n        \n        int maxx = 0,n = arr.size(), mask = 0;\n        set<int> s;\n        
```\nclass Solution {\npublic:\n    int findMaximumXOR(vector<int>& arr) {\n        \n        int maxx = 0,n = arr.size(), mask = 0;\n        set<int> s;\n        for (int i = 30; i >= 0; i--) {\n            mask |= (1 << i);\n\n            for (int i = 0; i < n; ++i) \n                s.insert(arr[i] & mask);\n\n            int newMaxx = maxx | (1 << i);\n            for (int prefix : se) {\n                 if (se.count(newMaxx ^ prefix)) {\n                    maxx = newMaxx;\n                    break;\n                }\n            }\n            se.clear();\n        }\n    return maxx;\n    }\n};\n```
['Bitmask']