You are viewing a single comment's thread. Return to all comments →
Went this way around with Javascript:
const HRS = "hackerrank"; function hackerrankInString(s: string): string { let matching = 0; for (let i = 0; i < s.length && matching < HRS.length; i++) { if (s[i] === HRS[matching]) matching++; } return matching === HRS.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 →
Went this way around with Javascript: