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