You are viewing a single comment's thread. Return to all comments →
Possible answer for Javascript;
let pos = 0; s.split('').forEach(char => { if (char === 'hackerrank'[pos]) { pos++; } }); return pos === '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 →
Possible answer for Javascript;