can i know where i am wrong i even seperated when length is odd

#include <bits/stdc++.h>

using namespace std;

int check(string s){

```
int l,c=0,mid;
l=s.length();
bool vis[l-1];
mid=l/2;
if(l%2!=0){
mid=(l/2)+1;
vis[mid-1]=true;
for(int i=0;i<mid-1;i++){
for(int j=mid;j<l;j++){
if(s[i]==s[j]&&vis[j]!=true){
vis[j]=true;
vis[i]=true;
c=1;
break;
}
else
c=0;
}
if(c==0)
break;
}
}
else{
mid=l/2;
for(int i=0;i<mid;i++){
for(int j=mid;j<l;j++){
if(s[i]==s[j]&&vis[j]!=true){
vis[j]=true;
vis[i]=true;
c=1;
break;
}
else
c=0;
}
if(c==0)
break;
}
}
```

return c;

}

int main() {

int t,c;

string s;

cin>>t;

while(t–){

cin>>s;

c=check(s);

if(c==0)

cout<<“NO”<<endl;

else if(c==1)

cout<<“YES”<<endl;

}

return 0;

}