📅  最后修改于: 2022-03-11 15:03:49.643000             🧑  作者: Mango
function hackerrankInString(s) {
let str = 'hackerrank'
let status = ''
let j = 0;
for(let i = 0; i < s.length; i++) {
if(s[i] == str[j]) {
j++
}
}
status = j === str.length ? "YES" : "NO"
return status
}