https://school.programmers.co.kr/learn/courses/30/lessons/120956
from itertools import permutations
def solution(babbling):
joka = ['aya', 'ye', 'woo', 'ma']
p = []
for i in range(1, 5):
p += [''.join(p) for p in permutations(joka, i)]
cnt = 0
for b in babbling:
if b in p:
cnt += 1
return cnt
4가지 단어만 발음할 수 있기 때문에, permutation을 활용해 모든 조합을 찾고 비교한다.
#itertools # permutations #replace #join