The problem k-good strings 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.
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.