// 'aya', 'ye', 'woo', 'ma'
const checkPossible=(word)=>{
let count=0;
let pList=['aya', 'ye', 'woo', 'ma']
for (let i=0;i<pList.length;i++){
if (word.includes(pList[i].repeat(2))){
break;
}
word=word.split(pList[i]).join(' ');
}
if (word.split(' ').join('').length===0){
count+=1;
}
return count;
}
function solution(babbling) {
var answer = 0;
for (let i=0;i<babbling.length;i++){
answer+=checkPossible(babbling[i], answer);
}
return answer;
}
분명 정답률 순으로 정렬해서 풀고 있는데 레벨이 들쭉날쭉이다