#include using namespace std; int main(){ int q; cin >> q; const char* hackerrank = "hackerrank"; int hackerrank_len = string(hackerrank).size(); for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; // your code goes here int l = s.size(); bool found = true; int pos = 0; for (int i = 0; i < hackerrank_len && found; i++) { if (pos >= l) { found = false; break; } auto x = s.find(hackerrank[i], pos); if (x == string::npos) found = false; pos = x + 1; } cout << (found ? "YES" : "NO") << endl; } return 0; }