Maximum XOR using Trie

00:00
HardTrieBit Manipulation
GoogleCodeforces

Find the maximum XOR value of any two numbers in an array using a Trie (binary trie).

Examples

Input → [3,10,5,25,2,8]
Output → 28
Note: 5 XOR 25 = 28
Input → [0]
Output → 0
Input → [1,2,4]
Output → 5
Note: 1 XOR 4 = 5