Tap here to switch tabs
Problem
Submissions

Problem: Maximum Strong Pair XOR I

Maximum Strong Pair XOR I asks you to choose two integers from an array whose absolute difference is at most the smaller value, then return the largest bitwise XOR. Values may pair with themselves.

Statement

You are given an integer array nums. A pair of integers (x, y) is called a strong pair if it satisfies the condition ∣x−y∣≤min⁡(x,y)|x - y| \leq \min(x, y).

You may choose any two integers from nums to form a strong pair.

Return the maximum bitwise XOR value among all possible strong pairs in nums.

Note: An element can be paired with itself to form a strong pair.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 1≤1 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Strong Pair XOR I

Maximum Strong Pair XOR I asks you to choose two integers from an array whose absolute difference is at most the smaller value, then return the largest bitwise XOR. Values may pair with themselves.

Statement

You are given an integer array nums. A pair of integers (x, y) is called a strong pair if it satisfies the condition ∣x−y∣≤min⁡(x,y)|x - y| \leq \min(x, y).

You may choose any two integers from nums to form a strong pair.

Return the maximum bitwise XOR value among all possible strong pairs in nums.

Note: An element can be paired with itself to form a strong pair.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 1≤1 \leq nums[i] ≤100\leq 100