421. Maximum XOR of Two Numbers in an Array
Problem Statement
Given an integer array nums
, return the maximum result of nums[i] XOR nums[j]
, where 0 <= i <= j < n
.
Example 1:
Example 2:
Constraints:
1 <= nums.length <= 2 * 105
0 <= nums[i] <= 231 - 1
Intuition
Links
https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/description/
Video Links
Approach 1:
C++
Approach 2:
C++
Approach 3:
C++
Approach 4:
C++
Similar Problems
Previous1698-Number of Distinct Substrings in a String Using TrieNext1707. Maximum XOR With an Element From Array
Last updated