C++ Trie 69ms beats 85%
\nclass Solution {\npublic:\n    class TreeNode {\n    public:\n        TreeNode* next[2];\n        TreeNode () {next[0] = NULL; next[1] = NULL;};\n    };\n    
```\nclass Solution {\npublic:\n    class TreeNode {\n    public:\n        TreeNode* next[2];\n        TreeNode () {next[0] = NULL; next[1] = NULL;};\n    };\n    TreeNode* buildTree(vector<int>& nums) {\n        TreeNode* root = new TreeNode(), *cur;\n        int n = nums.size();\n        for (int i = 0; i < n; i++) {\n            int num = nums[i];\n            cur = root;\n            for (int j = 31; j >= 0; j--) {\n                int index = ((num >> j) & 1);\n                if (cur->next[index] ==  NULL)\n                    cur->next[index] = new TreeNode();\n                cur = cur->next[index];\n            }\n        }\n        return root;\n    }\n    \n    int helper(TreeNode* cur, int num) {\n        int res = 0;\n        for (int i = 31; i >= 0; i--) {\n            int index = ((num >> i) & 1) ? 0 : 1;\n            if (cur->next[index]) {\n                res <<= 1;\n                res |= 1;\n                cur = cur->next[index];\n            } else {\n                res <<= 1;\n                res |= 0;\n                cur = cur->next[index ? 0 : 1];\n            }\n        }\n        return res;\n    }\n    \n    int findMaximumXOR(vector<int>& nums) {\n        int res = 0;\n        TreeNode* root = buildTree(nums);\n        \n        for (auto i : nums) {\n            res = max(res, helper(root, i));\n        }\n        \n        return res;\n    }\n};\n```
[]