You are viewing a single comment's thread. Return to all comments →
C++ solution
string hackerrankInString(string s) { string s1("hackerrank"); string str("");
for (int i = 0; i < s1.size(); i++) { for (int j = 0; j < s.size(); j++) { if (s1[i] == s[j]) { str += s[j]; i++; if (str == s1) return "YES"; } } } return "NO";
}
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →
C++ solution
string hackerrankInString(string s) { string s1("hackerrank"); string str("");
}