My issue
My code
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
for(int j=0;j<26;j++){
bool st=0;
bool ed=0;
int start=0;
int end=n-1;
char fix='a'+j;
while(start<n){
if(s[start]==fix && start%3==0){
st=true;
}
start++;
}
while(end>=0){
if(s[end]==fix && (n-end-1)%3==0){
ed=true;
}
end--;
}
if(st==true && ed==true){
cout<<"yes"<<endl;
break;
}
if(j==25){
cout<<"No"<<endl;
}
}
}
}
Problem Link: BLAST3 Problem - CodeChef