https://programmers.co.kr/learn/courses/30/lessons/49993
스킬트리
const solution = (skill,list)=>{
let result = 0;
for(let v of list ){
let skillStack = "";
let test = true;
for(let i = 0 ; i<v.length;i++){
if(skill.indexOf(v[i])!== -1 && skill.indexOf(v[i]) <= skillStack.length){
skillStack += v[i];
}else if(skill.indexOf(v[i])!==-1){
test = false
break;
}
}
if(test){
console.log(v)
result++;
}
}
return result;
}