You are given two integers $C, K$ and an array of $N$ integers $a_1, a_2, ..., a_N$. It is guaranteed that the value of $a_i$ is between $1$ to $C$.
We define that a continuous subsequence $a_l, a_{l + 1}, ..., a_r(l\leq r)$ of array a is a good subarray if and only if the following condition is met:
\begin{equation*}
\forall x \in [1, C], \; \sum\limits_{i = l}^r[a_i = x] = 0 \; or \; \sum\limits_{i = l}^r[a_i = x] \geq K
\end{equation*}
It implies that if a number appears in the subarray, it will appear no less than $K$ times.
You should find the longest good subarray and output its length. Or you should print $0$ if you cannot find any.