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