arr [ i ] cannot make s pair with itself i . e . ( arr [ i ] , arr [ i ] )
if ( i === j ) cnt += parseInt ( ( bitMask [ i ] * bitMask [ i ] - 1 ) / 2 ) ; else cnt += bitMask [ i ] * bitMask [ j ] ; } } } return cnt ; }