#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 checkStr[]= "hackerrank"; int counter = 0; int qCount = 0; int end = strlen(checkStr); char cur = s[0]; while(cur != '\0'){ if(cur == checkStr[counter]) counter++; if(counter >= end){ printf("%s","YES\n"); break; } qCount++; cur = s[qCount]; } if(counter >= end) continue; printf("%s","NO\n"); } return 0; }