Uniform After K Repaints
You are given a string s of n uppercase English letters and an integer k.
You may repaint at most k positions of s: each repaint replaces the letter at one position with any uppercase letter of your choice. After repainting, look for the longest contiguous block of positions that all hold the same letter.
What is the largest length that block can have?
Input
The first line contains two integers n and k (1 ≤ n ≤ 10^6, 0 ≤ k ≤ n).
The second line contains the string s of exactly n uppercase English letters (A to Z).
Output
Print one integer: the maximum possible length of a block of equal consecutive letters after at most k repaints.
Notes
In the first example, AABABBA with k = 1: repainting the A at position 4 (1-based) gives AABBBBA, which has a block of four Bs. No single repaint produces a block of five.
In the second example, with k = 2 you can turn ABAB into AAAA (or BBBB), so the answer is the whole string.