diff --git "a/heeheej/programmers/PRG_84512_\353\252\250\354\235\214\354\202\254\354\240\204.py" "b/heeheej/programmers/PRG_84512_\353\252\250\354\235\214\354\202\254\354\240\204.py" new file mode 100644 index 0000000..a0db80a --- /dev/null +++ "b/heeheej/programmers/PRG_84512_\353\252\250\354\235\214\354\202\254\354\240\204.py" @@ -0,0 +1,21 @@ +# 모음사전 +# 프로그래머스 코딩테스트 고득점 kit > 완전탐색 +# 1278 (+1) +# 중복순열 product 사용해서 리스트 만든 후, 사전순으로 정렬한다음 인덱스찾기 + +from itertools import product +def solution(word): + answer = 0 + moeum = ["A", "E", "I", "O", "U"] + arr = [] + for i in range(1, 6): + prods = product(moeum, repeat = i) + for prod in prods: + temp = ''.join(prod) + arr.append(temp) + arr.sort() + for i, x in enumerate(arr): + if word == x: + answer = i+1 + break + return answer \ No newline at end of file diff --git "a/heeheej/week27/PRG_84512_\353\252\250\354\235\214\354\202\254\354\240\204.py" "b/heeheej/week27/PRG_84512_\353\252\250\354\235\214\354\202\254\354\240\204.py" new file mode 100644 index 0000000..a0db80a --- /dev/null +++ "b/heeheej/week27/PRG_84512_\353\252\250\354\235\214\354\202\254\354\240\204.py" @@ -0,0 +1,21 @@ +# 모음사전 +# 프로그래머스 코딩테스트 고득점 kit > 완전탐색 +# 1278 (+1) +# 중복순열 product 사용해서 리스트 만든 후, 사전순으로 정렬한다음 인덱스찾기 + +from itertools import product +def solution(word): + answer = 0 + moeum = ["A", "E", "I", "O", "U"] + arr = [] + for i in range(1, 6): + prods = product(moeum, repeat = i) + for prod in prods: + temp = ''.join(prod) + arr.append(temp) + arr.sort() + for i, x in enumerate(arr): + if word == x: + answer = i+1 + break + return answer \ No newline at end of file