Tap here to switch tabs
Problem
Submissions

Problem: Number of Unique XOR Triplets II

med
30 min
Try to solve the Number of Unique XOR Triplets II problem.

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

med
30 min
Try to solve the Number of Unique XOR Triplets II problem.

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