Sobes.tech
Intern

A. The Best Scientific Laboratory In a certain city, several scientific laboratories are researching bacterial cultures. They study a sequence of samples, where each sample belongs to a specific strain (type of bacteria). The chief biological research university announced a contest: to find the maximum number of consecutive samples that can be analyzed considering the restriction. Specifically: in any continuous segment of the sequence, there should be no more than K different strains. Our laboratory strives to become the best in the city. To win the contest, we need to find exactly such a maximum length of a segment that satisfies the strict condition. We are counting on you, because in case of victory, the laboratory will receive a grant that will open new horizons for our research. Input format The first line contains two numbers: N — the length of the sample sequence and K — the restriction on the number of different strains. The second line contains N numbers — the elements of the sequence. Output format The program should output the number of the maximum length of a segment of the sample sequence. Example 1 Input [phone] Output 3