Array to store frequency of characters in given string
var count = Array ( 26 ) . fill ( 0 ) ; for ( var i = 0 ; i < N ; i ++ ) { count [ S [ i ] . charCodeAt ( 0 ) - 97 ] ++ ; } var E = N / K ; var greaterE = [ ] ; var lessE = [ ] ; for ( var i = 0 ; i < 26 ; i ++ ) {