link to the question: https://www.codechef.com/LTIME81B/problems/NOTALLFL

my code shows TLE for the last case…

```
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int T;
cin >> T;
while(T--)
{
int n,k,i,j,z;
cin >> n >> k;
vector<int> A(n),flv(k+1);
for(i=0;i<k+1;i++)
flv[i]=0;
for(i=0;i<n;i++)
cin >> A[i];
int flv_count,count,max=0;
for(i=0;i<n;i++)
{
flv_count=0,count=0;
for(j=i;j<n;j++)
{
if((flv_count==k-1 && flv[A[j]]==0) || (count+n-j)<max)
break;
else
{
if(flv[A[j]]==0){
flv[A[j]]=1;
flv_count++;
}
count++;
}
}
if(count>max)
max=count;
if((n-i)<max)
break;
for(z=0;z<k+1;z++)
flv[z]=0;
}
cout << max << endl;
}
return 0;
}
```