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