728x90
반응형
문제출처: https://school.programmers.co.kr/learn/courses/30/lessons/84512
풀이:
from itertools import product
def solution(word):
words = ['A', 'E', 'I', 'O', 'U']
list = []
for i in range(1,6):
for j in product(words, repeat = i):
list.append("".join(j))
return sorted(list).index(word) + 1
중복순열을 사용해봤다.
반응형
댓글