Sanket And Strings

Unable to understand the question

Hi @ravig8233
In this question you are given an integer k and a string of a and b. What you need to do is that you have to replace either a by b or b by a at most k time so that you get a string of maximum length of either continuous a or continuous b. For example if we are give 2 and aabababaabb then we replace b at index 2 and 4 then we get string of a of length 6 hence 6 will be the ans.