i have to find a substring,whether it is present or not. giving a wrong answer on codechef but all possible test cases i could think of are running properly.Please help me out. Thanks in advance!

#include<bits/stdc++.h>

using namespace std;

int main()

{

long long int t,i,n,m,coun;

cin>>t;

```
while(t--)
{
cin>>n;
long int a[n];
for(i=0;i<n;i++)
cin>>a[i];
cin>>m;
long int b[m];
for(i=0;i<m;i++)
cin>>b[i];
coun=0;
for(i=0;i<n;i++)
{
if(a[i]==b[coun])
coun++;
else if(a[i]==b[0])
coun=1;
else if(a[i]!=b[coun])
coun=0;
if(coun==m)
break;
}
if(coun==m)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return 0;
```

}