#include #include #include #include #include #include #include int main(){ int q; char *p1, *p2; char str[11] = {"hackerrank"}; scanf("%d",&q); for(int a0 = 0; a0 < q; a0++){ char* s = (char *)malloc(512000 * sizeof(char)); p1 = &str[0]; p2 = &s[0]; scanf("%s",s); while(*p2 != '\0') { if(*p2 == *p1) { p1++; p2++; } else { p2++; } if(*p1 == '\0') { printf("YES\n"); break; } } if(*p1 != '\0') { printf("NO\n"); } } return 0; }