Class Solution
-
- All Implemented Interfaces:
public final class Solution421 - Maximum XOR of Two Numbers in an Array.
Medium
Given an integer array
nums, return the maximum result ofnums[i] XOR nums[j], where0 <= i <= j < n.Example 1:
Input: nums = 3,10,5,25,2,8
Output: 28
Explanation: The maximum result is 5 XOR 25 = 28.
Example 2:
Input: nums = 14,70,53,83,49,91,36,80,92,51,66,70
Output: 127
Constraints:
<code>1 <= nums.length <= 2 * 10<sup>5</sup></code>
<code>0 <= numsi<= 2<sup>31</sup> - 1</code>
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
Method Summary
Modifier and Type Method Description final IntegerfindMaximumXOR(IntArray nums)-
-
Method Detail
-
findMaximumXOR
final Integer findMaximumXOR(IntArray nums)
-
-
-
-