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