From 86948d6aa048009d7379bb5b6e7c36fb931724ae Mon Sep 17 00:00:00 2001 From: heeheejj Date: Sat, 21 Oct 2023 23:30:11 +0900 Subject: [PATCH] =?UTF-8?q?Week27=20PRG=2084512=20=EB=AA=A8=EC=9D=8C?= =?UTF-8?q?=EC=82=AC=EC=A0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...50\354\235\214\354\202\254\354\240\204.py" | 21 +++++++++++++++++++ ...50\354\235\214\354\202\254\354\240\204.py" | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 "heeheej/programmers/PRG_84512_\353\252\250\354\235\214\354\202\254\354\240\204.py" create mode 100644 "heeheej/week27/PRG_84512_\353\252\250\354\235\214\354\202\254\354\240\204.py" 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