(프로그래머) 배블(2)

def solution(babbling): x=(“aya”, “ye”, “woo”, “ma”) answer=0 for word in babbling: for i in x: if i*2 not in word: word=word.replace(i,’ ‘) if word.strip()==””: answer+=1 return answer 옹알이(1)와 달리 연속적이지 않으면 재사용이 가능하다.따라서 i*2가 발생하지 않으면 모든 i를 공백으로 바꿉니다.이것도 babble과 같은 공백으로 대체해야 합니다(1).replace(i,””) 문자를 제거합니다.새로 생성된 어레이에서 다음 교체가 수행되었기 때문에 문제가 발생했습니다.