hey, I am not able to solve that can you help me out
I did'nt able to understand the logic
Deepak, in this question, you are given a string of a and b as characters, and you have to determine what will be the length of maximum substring formed using a single type of character only, As per the test case, Simply you will traverse the each character of string, and check, if it is equal to b, then in that case, you will increment the counter, and you need to make sure tht counter doesnt exceeds the given value of k, if it does, you will start the value again from 0 only.
For sample input, the k=2, it means that you can atmost swap 2 elements in the string and change b to a, then the max length of substring with single character will be 4, hence the output is 4.
hey, this is what i am doing can you help and tell me where m I going wrong with the logic.
Ajay, plz tell if you are still facing issues with the approach i discussed on chat with you.