Create a count array to store count of numbers that have a particular bit set . count [ i ] stores count of array elements with i - th bit set .
let sizeof_let = 4 ; let LET_SIZE = 8 * sizeof_let ; let count = Array . from ( { length : LET_SIZE } , ( _ , i ) => 0 ) ;