Skip to content

Commit c3b3d89

Browse files
authored
[오늘의 알고리즘] 모음사전 (#77)
1 parent 28776c3 commit c3b3d89

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

yongjun-0903/모음사전.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from itertools import product
2+
3+
def solution(word):
4+
vowels = ['A', 'E', 'I', 'O', 'U']
5+
6+
dictionary = []
7+
8+
for i in range(5):
9+
for v in product(vowels, repeat = i+1):
10+
dictionary.append(''.join(v))
11+
dictionary.sort()
12+
13+
return dictionary.index(word) + 1

0 commit comments

Comments
 (0)