For 0 bit answer will be total count of same number
if ( k == 0 ) { for ( let i = 0 ; i <= MAX ; ++ i ) ans += parseInt ( ( count [ i ] * ( count [ i ] - 1 ) ) / 2 ) ; return ans ; } for ( let i = 0 ; i <= MAX ; ++ i ) {