please explain the que, m not undersatanding the que
Please explain the que
you are given a string composed of two character a & b
now u are given an interger k which signifies the maximum no of swaps ( changing a to b or b to a )
such the a substring of maximum length with all the same character is obtained
eg: abba is given and k = 2
then we could swap both the b`s to form aaaa
so maximum perfectness after atmost k swaps is 4
eg2 aabbabba k = 2
u could swap 2 bs ull get the strign
a) aaaaabba b) aabaaaba c) aabbaaaa so maximum perfectness is got from option a) ie 5
u could swap 2 a`s to gain perfectness
a) aabbbbbb b) bbbbabba … a) option gives maximum perfectness
of size 6
hence max of case 1 and case 2 is 6
HINT: sliding window could be used to perform this operation