You are viewing a single comment's thread. Return to all comments →
C++ solution:
std::string hackerrankInString(std::string s) { std::string hackerrank = "hackerrank"; int j = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == hackerrank[j]) { j++; } if (j == hackerrank.size()) { 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: