Count the frequency in the string
for ( var i = 0 ; i < n ; ++ i ) freq [ s [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] ++ ; var se = [ ] ; for ( var i = 0 ; i < 26 ; ++ i ) if ( freq [ i ] > 0 )