문제 링크 - https://programmers.co.kr/learn/courses/30/lessons/84512


from itertools import product
def solution(word):
dict = []
for i in range(1, 6):
dict.extend((list(map(''.join, product(['A', 'E', 'I', 'O', 'U'], repeat = i)))))
dict.sort()
return dict.index(word)+1
x = [1,2,3,4] y = [1,2] x.append(y) # x = [1,2,3,4,[1,2]] x.extend(y) # x [ 1,2,3,4,1,2]x = [1,2,3,4] y = [[1,2], [3,4]] x.append(y) # x = [1,2,3,4,[[1,2], [3,4]]] x.extend(y) # x = [1,2,3,4,[1,2], [3,4]]
from itertools import product
solution = lambda word: sorted(["".join(c) for i in range(5) for c in product("AEIOU", repeat=i+1)]).index(word) + 1