Variable to store the frequency of the least frequent of first K alphabets
var minimum = mp . get ( ' ' ) ; for ( var i = 1 ; i < K ; i ++ ) { minimum = Math . min ( minimum , mp . get ( String . fromCharCode ( i + ' ' . charCodeAt ( 0 ) ) ) ) ; } return minimum * K ; }