How to solve this problem on bitmasks

Revision en1, by DLN, 2020-06-23 09:45:35

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

Tags #bitmask

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English DLN 2020-06-23 09:45:35 272 Initial revision (published)