2932. Maximum Strong Pair XOR I
You are given a 0-indexed integer array
nums
. A pair of integersx
andy
is called a strong pair if it satisfies the condition:
|x - y| <= min(x, y)
You need to select two integers from
nums
such that they form a strong pair and their bitwiseXOR
is the maximum among all strong pairs in the array.Return the maximum
XOR
value out of all possible strong pairs in the arraynums
.Note that you can pick the same integer twice to form a pair.
1 | class Solution { |