Company: EPAM
Difficulty: medium
You have been provided with a binary string str of length n . In one operation, you can flip any character in str , changing a 1 to 0 or vice versa. Your task is to determine the length of the longest substring composed of the same characters, given that you can perform no more than k operations. Input Format The first line contains an integer n denoting the length of the string str . The second line contains the binary string str of length n . The third line contains an integer k denoting the maximum number of flips you can make in the string. Output Format Print a single integer - the length of the longest substring that contains the same character after performing at most k operations. Constraints 1 <= n <= 10 5 0 <= k <= n str consists only of the characters 0 and 1 . Sample Input 1 10 0111110010 2 Sample Output 1 8 Explanation 1 Flip the characters at index 6 and index 7 (0-based) to obtain the string 0111111110 . The maximum length of a substring with the same charact