Answers to: Doubt in "k-good" editorialhttps://discuss.codechef.com/questions/81892/doubt-in-k-good-editorial<p>The problem <a href="https://www.codechef.com/SNCKQL16/problems/KGOOD">k-good strings</a> from snackdown qualifier. In the editorial's optimization section it is written that we need to consider only those m's that is value of some count. Anyone please explain this part of the editorial.</p>enThu, 02 Jun 2016 12:55:09 +0530Answer by asutoshranahttps://discuss.codechef.com/questions/81892/doubt-in-k-good-editorial/81896<p>We need to consider only those m's(m is the minimum frequency count of the alphabets) which are equal to some wc (alphabet frequency).
Suppose we have alphabet frequencies as 10 20 30 40 50 and K=5.
So for m=[0,10] we get the the sequence of 10 20 30 40 50.
Similarly for m=[11,20] we get the sequence of 20 30 40 50.
and so on.....
So we only calculate for those values of m which are equal to some wc.</p>asutoshranaThu, 02 Jun 2016 12:55:09 +0530https://discuss.codechef.com/questions/81892/doubt-in-k-good-editorial/81896