Problem Statement — Given an array count the no. of distinct pairs of elements such that their AND(&) is an exact power of 2.
array size <= 1e5 and 1 <= a[i] <= 2^12
Example — array -> [10 7 8 2 3] ; answer = 6
How to solve this problem on bitmasks
Problem Statement — Given an array count the no. of distinct pairs of elements such that their AND(&) is an exact power of 2.
array size <= 1e5 and 1 <= a[i] <= 2^12
Example — array -> [10 7 8 2 3] ; answer = 6