Traverse through all bit counts ( Note that we sort array in decreasing order )
for ( let i = 31 ; i >= 0 ; i -- ) { let v1 = count [ i ] ; for ( let p = 0 ; p < v1 . length ; p ++ ) arr [ j ++ ] = v1 [ p ] ; } }