BETA

Submissions : 70 Accuracy :

18.57

Maximum Sub-String after at most K changes
     

We have a string of length n, which consist only UPPER and LOWER CASE characters and we have a number k (always less than n and greater than 0). We can make at most k changes in our string such that we can get a sub-string of maximum length which have all same characters.

Input:
The first line of the input contains an integer T which denotes the number of test cases to follow. Each test case contains space separated 2 integers n and k. Next line has a string of length n. 

Output:
Print an integer which denotes the maximum length possible.

Constraints:
1<=T<=100
1<=n,k<=100000
1<=|S|<=100000​​

Example:
Input:

2
5 2
ABABA
6 4
HHHHHH

Output:
5
6

**For More Examples Use Expected Output**


Contributor: Shashwat Jain

Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.