#include #include using namespace std; int main(){ int q; cin >> q; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; // your code goes here string key = "hackerrank"; int keyPosition = 0; string builder(10, ' '); for(string::iterator it = s.begin(); it != s.end(); ++it){ if(keyPosition > 9){ break; } if(*it == key[keyPosition]){ builder[keyPosition] = (*it); keyPosition++; } } if(builder == key){ cout << "YES" << endl; }else{ cout << "NO" << endl; } } return 0; }