Company: CARS24
Difficulty: medium
Matching Substring Given two strings A and B . Your task is to remove a few characters from string A so that the number of substrings of A that are matching string B is exactly K . Find the least number of characters that must be removed from string A so that the mentioned condition is satisfied. Note: Both the strings A and B contain lowercase English letters, that is, a-z only. Function Description Complete the solve function provided in the editor. This function takes the following 3 parameters and returns the answer: K: Represents the integer value A: Represents the first string B: Represents the second string Input Format Note: Use this input format if you are testing against custom input or writing code in a language where we don’t provide boilerplate code. The first line contains T , which represents the number of test cases. For each test case: The first line contains K denoting the number of substrings that must be exactly matched. The second line contains string A . The third