#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 target[] = "hackerrank"; int indecies[10] = {0,0,0,0,0,0,0,0,0,0}; int j=0; for (int i=0; i<10; ++i) { while (s[j] !='\0' && s[j] != target[i]) {++j;} if (s[j]=='\0') { printf("NO\n"); break;} indecies[i] = j; j++; } if (indecies[9]>0) {printf("YES\n");} } return 0; }