Why code is wrong? problem code - CHEFROUT

#include
using namespace std;

int main(){
int T; cin>>T;
while(T–){
string s; cin>>s;
int count = 0;
for(int i=0;i<s.size()-1;i++){
if(s[i] == ‘C’){
if(s[i+1] == ‘E’ || s[i+1] == ‘S’ || s[i+1] == ‘C’)
count++;
}
else if(s[i] == ‘E’){
if(s[i+1] == ‘S’ || s[i+1] == ‘E’)
count++;
}
else if(s[i] == ‘S’){
if(s[i+1] == ‘S’)
count++;
}
}
if(count == s.size()-1)
cout<<“YES”<<endl;
else
cout<<“NO”<<endl;
}
}

EEE
SEEE
Include condition for these valid cases

else if(s[i] == ‘E’){
if(s[i+1] == ‘S’ || s[i+1] == ‘E’)
count++;
}
it will check for EEE.

SEEE is false.

can you provide me code of this problem in c language?

look at the editorial

image
“yes” “no” :heavy_check_mark:
“YES” “NO” :x: