136. Maximum XOR of Two Numbers in an Array

Given an array of non-negative integers nums, return the maximum value of nums[i] XOR nums[j] where i != j.
Example 1
Input: nums = [10,25,5,3,2,8]
Output: 28
Explanation: Maximum XOR: 25 XOR 5 = 28.
Example 2
Input: nums = [0]
Output: 0
Explanation: Single element — XOR with itself is not possible, answer is 0.
arraysmediumtrie
JavaScript
Loading...
Line 1, Char 1