Sanket and strings problem

i dont get the question …
what the are trying to say…

Hi @soorya19k
The question describes the perfectness of a string as the maximum length substring with same characters
for eg aaa is perfect string of length 3, aaabb is not a perfect string because all characters are not same, but the substring “aaa” is perfect. the substring “bb” is also perfect. now the length of “aaa” is 3 and length of “bb” is 2, so we report the prefectness as 3 (because it is the maximum length perfect substring)

Now, you have to change some characters in the string such that maximum possible perfectness is achieved. You are allowed to change a maximum of k characters.

In the sample input, abba is given, and k = 2 , Now we can either change the string to aaaa (by changing s[1] and s[2]) or change the string to bbbb (by changing s[0] and s[3]). In both the cases the longest substring with equal characters is of length 4, hence the perfectness reported is 4. You have to change the characters in such a way that maximum perfectness can be achieved

hey, is there something that u did not understand. from the above explanation

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.