Tap here to switch tabs
Problem
Submissions

Problem: Maximum XOR After Operations

med
30 min
Try to solve the Maximum XOR After Operations problem.

Statement

You are given a 00 indexed integer array nums. In a single operation, you may select any non negative integer x and an index i, and update nums[i] to nums[i] AND (nums[i] XOR x).

You may perform this operation any number of times on any indices.

Return the maximum possible bitwise XOR sum of all elements in nums after applying the operation any number of times.

Constraints:

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

  • 0≤0 \leq nums[i] ≤108\leq 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum XOR After Operations

med
30 min
Try to solve the Maximum XOR After Operations problem.

Statement

You are given a 00 indexed integer array nums. In a single operation, you may select any non negative integer x and an index i, and update nums[i] to nums[i] AND (nums[i] XOR x).

You may perform this operation any number of times on any indices.

Return the maximum possible bitwise XOR sum of all elements in nums after applying the operation any number of times.

Constraints:

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

  • 0≤0 \leq nums[i] ≤108\leq 10^8