1. C++ trie solution   2. C++ bitmanipulation solution
TRIE:\n\n#define MAX 31\nstruct trie{\n    int num;\n    trie *child[2];\n};\ntrie* newnode(){\n    trie *temp = new trie;\n    temp->child[0]=temp->child[1]=NU
TRIE:\n```\n#define MAX 31\nstruct trie{\n    int num;\n    trie *child[2];\n};\ntrie* newnode(){\n    trie *temp = new trie;\n    temp->child[0]=temp->child[1]=NULL;\n    temp->num = 0;\n    return temp;\n}\nvoid insert(trie* root,int n){\n   // trie *temp = root;\n    for(int i=MAX;i>=0;i--){\n        bool res = ((n)&(1<<i));\n        if(root->child[res]==NULL)root->child[res]=newnode();\n        root=root->child[res];\n    }\n    root->num = n;\n    return;\n}\nint fxor(trie *root,int n){\n    //trie *temp = root;\n    for(int i=MAX;i>=0;i--){\n        bool res = ((n)&(1<<i));\n        if(root->child[1-res]!=NULL)root=root->child[1-res];\n        else if(root->child[res]!=NULL)root=root->child[res];\n    }\n    return (root->num)^(n);\n}\nclass Solution {\npublic:\n    int findMaximumXOR(vector<int>& nums) {\n        trie *root = newnode();\n        insert(root,nums[0]);\n        int res = 0;\n        for(int i=1;i<nums.size();i++){\n            int val = fxor(root,nums[i]);\n            res = max(res,val);\n            insert(root,nums[i]);\n        }\n        return res;\n       \n    }\n};\n```\nBitmanip:\n```\nint maxi = 0,mask = 0;\n        for(int i=31;i>=0;i--){\n            mask = mask|(1<<i);\n            set <int> s;\n            for(int j=0;j<nums.size();j++){\n                s.insert(mask&nums[j]);\n            }\n            int temp = maxi|(1<<i);\n            for(int j=0;j<s.size();j++){\n                if(s.find(temp ^ s[j])!=s.end()){\n                    maxi = temp;\n                    break;\n                }\n            }\n        }\n        \n        return maxi;\n\t\t\t\t```\n\t\t\t\t
[]