#include #include #include #include #include #include #include int main(){ int q; scanf("%d",&q); char hr[]="hackerrank"; int t=0; int flag=0; int p=0; for(int a0 = 0; a0 < q; a0++){ char* s = (char *)malloc(512000 * sizeof(char)); scanf("%s",s); int l=strlen(s); // your code goes here while(t<10){ if(s[p]==hr[t]){ t++; } p++; if(p>(l)){ flag=1; break; } } if(flag==0){ printf("YES\n"); } else if(flag==1){ printf("NO\n"); } t=0;p=0;flag=0; } return 0; }