Count zero-AND pairs
Your task
Given an array 'nums' of non-negative integers, count the number of ordered pairs (i, j) (i and j range independently over all indices, including i == j) such that nums[i] & nums[j] == 0, where & is bitwise AND. Return the count. 1 <= len(nums) <= 40000, 0 <= nums[i] < 2^16.
Examples
count_and_zero_pairs(nums: list[int]) -> intExample 1
Input
count_and_zero_pairs([1, 2, 3])Output
2