S
All challenges
Practice
Home
Blog
Practice
Examples
Feedback
Maximum XOR using Trie
00:00
Start
00:00
Sign in
Problem
Hints
3
Solution
History
Hard
Trie
Bit Manipulation
Google
Codeforces
Find the maximum XOR value of any two numbers in an array using a Trie (binary trie).
Examples
Example 1
Input →
[3,10,5,25,2,8]
Output →
28
Note:
5 XOR 25 = 28
Example 2
Input →
[0]
Output →
0
Example 3
Input →
[1,2,4]
Output →
5
Note:
1 XOR 4 = 5
JavaScript
Python
Java (Coming soon)
C (Coming soon)
C++ (Coming soon)
Reset
Run
Submit
Cases
Results