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