#include using namespace std; int main(){ int q, counter; string comp = "hackerrank"; cin >> q; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; // your code goes here counter = 0; for(int i = 0; i < s.size(); i++) { if(counter == 10) break; else if(s[i] == comp[counter]) counter++; } if(counter == 10) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }