#include #include using namespace std; int main() { int numOfStuffs; cin >> numOfStuffs; string strToFind = "hackerrank"; for(int i = 0; i < numOfStuffs; ++i) { string str; cin >> str; bool found = false; int nextCharToFind = 0; for(int j = 0; j < str.length(); ++j) { char currentChar = str[j]; if(currentChar == strToFind[nextCharToFind]) { nextCharToFind++; if(nextCharToFind == 10) { cout << "YES" << endl; found = true; break; } } } if(!found) { cout << "NO" << endl; } } }