making the mask for each of the number .
for ( let i = 0 ; i < n ; i ++ ) { let mask = 0 ; for ( let j = 0 ; j < str [ i ] . length ; ++ j ) mask |= ( 1 << ( str [ i ] [ j ] - ' ' ) ) ; cnt [ mask ] ++ ; }