#include using namespace std; bool isSubSequence(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> q; string s1="hackerrank",s2; for(int a0 = 0; a0 < q; a0++){ cin >> s2; if((isSubSequence(s1,s2,10,s2.size())==1)) cout << "YES"; else cout << "NO"; cout << "\n"; // your code goes here } return 0; }