You are viewing a single comment's thread. Return to all comments →
Javascript:
function hackerrankInString(s) { const hackerRank = 'hackerrank'; let index = 0; s.split('').forEach((char) => { if (char === hackerRank[index]) { index++; } }); return index === hackerRank.length ? 'YES' : '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 →
Javascript: