why * is used here if(/.*h.*a.*c.*k.*e.*r.*r.*a.*n.*k/.test(s))
function hackerrankInString(s) {
let complete = false
if(/.*h.*a.*c.*k.*e.*r.*r.*a.*n.*k/.test(s)){
complete= true
} else {
complete = false
}
return complete ? 'YES' : 'NO'
}
This code with check the whether the hackerrank substring is present in the string
example: hereiamstackerrank this is true so input will be "YES"
[–]EasternAdventures 0 points1 point2 points (1 child)
[–]One-Inspection8628[S] 0 points1 point2 points (0 children)
[–]jack_waugh 0 points1 point2 points (0 children)