Tap here to switch tabs
Problem
Submissions

Problem: Number of Unique XOR Triplets II

Number of Unique XOR Triplets II asks you to choose three positions from an integer array, allowing repeats, compute their bitwise XOR, and return how many distinct results are possible.

Statement

You are given an integer array nums.

Consider all possible triplets of indices (i,j,k)(i, j, k) such that 0≤i≤j≤k<0 \leq i \leq j \leq k < nums.length. For each triplet, evaluate the bitwise XOR sum nums[i] ^ nums[j] ^ nums[k].

Return the number of unique XOR values that can be formed.

Constraints:

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

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Unique XOR Triplets II

Number of Unique XOR Triplets II asks you to choose three positions from an integer array, allowing repeats, compute their bitwise XOR, and return how many distinct results are possible.

Statement

You are given an integer array nums.

Consider all possible triplets of indices (i,j,k)(i, j, k) such that 0≤i≤j≤k<0 \leq i \leq j \leq k < nums.length. For each triplet, evaluate the bitwise XOR sum nums[i] ^ nums[j] ^ nums[k].

Return the number of unique XOR values that can be formed.

Constraints:

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

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