Tap here to switch tabs
Problem
Submissions

Problem: Maximum Strong Pair XOR I

med
30 min
Try to solve the Maximum Strong Pair XOR I problem.

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

med
30 min
Try to solve the Maximum Strong Pair XOR I problem.

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