Array to store the count of each character
let count = new Array ( MAX ) ; count . fill ( 0 ) ; for ( let i = 0 ; i < s . length ; i ++ ) { count [ s [ i ] . charCodeAt ( ) - ' ' . charCodeAt ( ) ] ++ ; } let index = 0 ;