PLEASE EXPLAIN IT MORE DEEPY.
Not understandable
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 (It can also be bbbb),
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.
The strings consist of only ‘a’ and ‘b’
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.