clean c++ trie solution ||  faster than 91.05%
```\nstruct trie{\n    trie next[2];\n    trie()\n    {\n        next[0]=NULL;\n        next[1]=NULL;\n    }\n};\nclass TrieNode{\n    private:\n        trie ro
```\nstruct trie{\n    trie* next[2];\n    trie()\n    {\n        next[0]=NULL;\n        next[1]=NULL;\n    }\n};\nclass TrieNode{\n    private:\n        trie* root;\n    public:\n        TrieNode()\n        {\n            root=new trie();\n        }\n    \n    void insert(int num)\n    {\n        trie* curr=root;\n        \n        for(int i=31;i>=0;i--)\n        {\n            int bit=(num>>i)&1;\n            if(curr->next[bit]==NULL)\n            {\n                curr->next[bit]=new trie();\n            }\n            curr=curr->next[bit];\n        }\n    }\n    \n    int max_xor(int num)\n    {\n        trie* curr=root;\n        int ans=0;\n        for(int i=31;i>=0;i--)\n        {\n            int bit=(num>>i)&1;\n            \n            if(curr->next[!bit])\n            {\n                ans+=(1<<i);\n                curr=curr->next[!bit];\n            }\n            else\n            {\n                curr=curr->next[bit];\n            }\n        }\n        return ans;\n    }   \n};\nclass Solution {\npublic:\n    int findMaximumXOR(vector<int>& nums) {\n        int max_ans=0;\n        int n=nums.size();\n        \n        TrieNode* t=new TrieNode();\n        \n        for(int i=0;i<n;i++)\n        {\n            t->insert(nums[i]);\n            max_ans=max(max_ans,t->max_xor(nums[i]));\n        }\n        return max_ans;\n    }\n};\n\nplease upvote if found helpful : )
['Bit Manipulation', 'Trie', 'C', 'C++']