Tap here to switch tabs
Problem
Submissions

Problem: Maximum XOR of Subsequences

med
30 min
Try to solve the Maximum XOR of Subsequences problem.

Statement

You are given an integer array nums.

Select two subsequences from nums and calculate the bitwise XOR sum of the elements for each subsequence.

Return the maximum possible bitwise XOR value of the two XOR sums.

Constraints:

  • 2≤2 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum XOR of Subsequences

med
30 min
Try to solve the Maximum XOR of Subsequences problem.

Statement

You are given an integer array nums.

Select two subsequences from nums and calculate the bitwise XOR sum of the elements for each subsequence.

Return the maximum possible bitwise XOR value of the two XOR sums.

Constraints:

  • 2≤2 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤109\leq 10^9