You are viewing a single comment's thread. Return to all comments →
Here is my JS solution:
let hR = `hackerrank`; let j = 0; for(let i = 0; i < hR.length; i++){ j = s.indexOf(hR.charAt(i), j) + 1; if(j === 0){ return `NO`; } } 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 →
Here is my JS solution: