Unable to understand this question?

How can i proceed this question? The question itself is not clear.

You are given a string a of only two character ‘a’ and ‘b’, and the perfectness of a string is defined as maximum length of substring with equal number of character (that is all char are same). Also you are given k , it is the number of maximum characters you can change in order to increase the perfect length.
Eg
abba, k =2 (making it aaaa) so perfect string of length 4,
abaaaba, k=1, (making it aaaaaba or abaaaaa ) we will get length 5.
You should iterate string and every step maintain count of minority characters, as that will result in maximum length with minimum changes.