#include using namespace std; int main(){ int q; cin >> q; string searchstring = "hackerrank"; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; // your code goes here bool found = false; int pos = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == searchstring[pos]) { pos++; if (pos == searchstring.length()-1) found = true; } } if (found) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }