You are viewing a single comment's thread. Return to all comments →
C++ Solution
string hackerrankInString(string s) { string refS = "hackerrank"; size_t preIt = 0; for(size_t i = 0; i < refS.length(); i++) { size_t it = s.find_first_of(refS[i], preIt); if(it == string::npos) return "NO"; preIt = s.find_last_of(refS[i], it) + 1; } return "YES"; }
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