Company: Tavant_8_jan
Difficulty: medium
Computer Store There are n computers lined up on shelves in the local computer store. The brands of computers may be different. The shop assistant thinks the likelihood of selling products increases when computers of the same brand are placed in adjacent positions. The shop assistant would like to make at most k swaps to maximize the number of computers of the same brand adjacent to each other. Help the shop assistant to do that. Input The first line of input contains an integer n . The second line of input contains an integer k . The third line contains a string s of length n containing uppercase Latin letters. Each brand is represented with a single Latin letter in the given string. Output Print the maximum length of the adjacent computers of the same brand after making at most k swaps. Constraints 1 ≤ n ≤ 50 1 ≤ k ≤ 2500 Examples Example #1 Input: 4 1 ABCB Output: 2 Explanation: The shop assistant can make one swap, swapping the third and fourth computers ('C' and 'B').