Tap here to switch tabs
Problem
Submissions

Problem: Triples with Bitwise AND Equal To Zero

Triples with Bitwise AND Equal To Zero asks you to count ordered triplets of indexes in an integer array whose three selected values have a bitwise AND of zero.

Statement

You’re given an array of integers called nums. Your task is to count how many triplets of indexes (i, j, k) satisfy the condition nums[i] & nums[j] & nums[k] == 0, where & is the bitwise AND operator and 0≤0 \leq i,, j,, k ≤\leq nums.length.

Constraints:

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

  • 0≤0 \leq nums[i] ≤210\leq 2^{10}

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Triples with Bitwise AND Equal To Zero

Triples with Bitwise AND Equal To Zero asks you to count ordered triplets of indexes in an integer array whose three selected values have a bitwise AND of zero.

Statement

You’re given an array of integers called nums. Your task is to count how many triplets of indexes (i, j, k) satisfy the condition nums[i] & nums[j] & nums[k] == 0, where & is the bitwise AND operator and 0≤0 \leq i,, j,, k ≤\leq nums.length.

Constraints:

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

  • 0≤0 \leq nums[i] ≤210\leq 2^{10}