← All problemsSign in

982. Triples with Bitwise AND Equal To Zero

LeetCodeArrayHash TableBit ManipulationOpen on judge ↗

Given an integer array nums, return the number of AND triples. An AND triple is a triple of indices (i, j, k) such that: - 0 <= i < nums.length - 0 <= j < nums.length - 0 <= k < nums.length - nums[i] & nums[j] & nums[k] == 0, where & represents the bitwise-AND operator. Example 1: Input: nums = [2,1,3] Output: 12 Explanation: We could choose the following i, j, k triples: (i=0, j=0, k=1)

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start