Ugly but straight forward Python O(n) Trie solution
Ugly but straight forward Python Trie solution, first build a Trie with all the nums; then try to "pass" each num in nums through that Trie, \nif the path bifur
Ugly but straight forward Python Trie solution, first build a Trie with all the nums; then try to "pass" each num in nums through that Trie, \nif the path bifurcates at a node, took the opposite route,and update the current XOR result by adding 1 to the current bit.\n```\nclass Solution(object):\n    def findMaximumXOR(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        head=[None,None]\n        for num in nums:\n            node=head\n            for bit in range(31,-1,-1):\n                chd=int(bool(num&(1<<bit)))\n                if node[chd]==None:\n                    NewNode=[None,None]\n                    node[chd]=NewNode\n                    node=NewNode\n                else:\n                    node=node[chd]\n        maxXor=0\n        for num in nums:\n            node=head\n            curXor=0\n            for bit in range(31,-1,-1):\n                chd=int(bool(num&(1<<bit)))\n                if node[1^chd]:\n                    curXor|=1<<bit\n                    node=node[1^chd]\n                else:\n                    node=node[chd] \n            maxXor=max(maxXor,curXor)\n            \n        return maxXor\n```
[]