include <stdio.h>
int main() {
// your code goes here
int t;
scanf(“%d”,&t);
while(t–) {
int n;
scanf(“%d”,&n);
int c=0,s=0,e=0,em=0,m=0,mh=0,h=0;
for(int i=0; i<n; i++) {
char str[15];
scanf(“%s”,str);
if(str[5]==‘m’ && (str[6]==‘-’ || str[4]==‘-’)) {
// printf("%s ",str);
if(str[0]==‘e’ && str[5]==‘m’ && em!=1) {
em=1;
}
else if(mh!=1) {
mh=1;
}
}
else {
if(str[0]==‘c’) {
c=1;
}
else if(str[0]==‘s’) {
s=1;
}
else if(str[0]==‘e’) {
e=1;
}
else if(str[0]==‘m’) {
m=1;
}
else if(str[0]==‘h’) {
h=1;
}
}
// printf("%d %d %d %d %d %d %d %d\n",i,c,s,e,em,m,mh,h);
}
if(c==1 && s==1 && e==1 && (em==1 || m==1) && (mh==1 || h==1))
{
printf("Yes\n");
}
else {
printf("No\n");
}
}
}
above is my code and it is passing all test cases but on submission it even not passing a single test case.
please help me in this.