Stores frequency of characters
var fr = new Array ( 26 ) . fill ( 0 ) ; var ans = [ ] ; for ( i = 0 ; i < n ; i ++ ) { fr [ s [ i ] . charCodeAt ( 0 ) - " " . charCodeAt ( 0 ) ] ++ ; } var ch = " " , ch1 = " " ; for ( i = 0 ; i < 26 ; i ++ ) {