#include #include using namespace std; bool isSubSequence(string str1, string str2, int m, int n) { // Base Cases if (m == 0) return true; if (n == 0) return false; // If last characters of two strings are matching if (str1[m-1] == str2[n-1]) return isSubSequence(str1, str2, m-1, n-1); // If last characters are not matching return isSubSequence(str1, str2, m, n-1); } int main() { // your code goes here int q,m,n; string s,str; cin>>q; s="hackerrank"; m=10; while(q--) { getline(cin,str); n=str.length(); if(!isSubSequence(s,str,m,n)) { cout<<"YES"<