#include #include #include #include #include using namespace std; bool iss(string str1, string str2, int m, int n) { int j = 0; // For index of str1 (or subsequence // Traverse str2 and str1, and compare current character // of str2 with first unmatched char of str1, if matched // then move ahead in str1 for (int i=0; i>a; while(a--) { string s="hackerrank",ste; cin>>ste; if(iss(s,ste,10,ste.length())) cout<<"YES\n"; else cout<<"NO\n"; } return 0; }