#include using namespace std; int main(){ string h = "hackerrank"; int q; cin >> q; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; int ok = 0; for(int i = 0; i< s.length(); i++) if (s[i] == h[ok]) ok++; if (ok == 10) cout << "YES\n"; else cout << "NO\n"; // your code goes here } return 0; }