#include using namespace std; int main(){ int q; string test = "hackerrank"; cin >> q; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; char *p = &s[0]; char *t = &test[0]; while(( *p && *t )) { if(*p == *t){ p++; t++; } else p++; } if(!(*t)) cout << "YES" << endl; else cout << "NO" << endl; // your code goes here } return 0; }