#include using namespace std; int main(){ int q; cin >> q; string hr = "hackerrank"; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; // your code goes here int curridx = 0; bool ok = true; for (char c: hr) { int idx = s.find_first_of(c, curridx); if (idx >= s.size()) { //didn't find ok = false; break; } else { curridx = idx + 1; } } cout << (ok ? "YES" : "NO") << endl; } return 0; }