From 3c27d95b10377e518644316b89d73c2695af0a8e Mon Sep 17 00:00:00 2001
From: SSUM <116950962+ssum21@users.noreply.github.com>
Date: Thu, 13 Feb 2025 11:04:09 +0900
Subject: [PATCH] =?UTF-8?q?[level=202]=20Title:=20=EB=AA=A8=EC=9D=8C=20?=
=?UTF-8?q?=EC=82=AC=EC=A0=84,=20Time:=202.45=20ms,=20Memory:=2010.3=20MB?=
=?UTF-8?q?=20-BaekjoonHub?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
프로그래머스/2/84512. 모음 사전/README.md | 80 ++++++++++++++++++++
프로그래머스/2/84512. 모음 사전/모음 사전.py | 27 +++++++
2 files changed, 107 insertions(+)
create mode 100644 프로그래머스/2/84512. 모음 사전/README.md
create mode 100644 프로그래머스/2/84512. 모음 사전/모음 사전.py
diff --git a/프로그래머스/2/84512. 모음 사전/README.md b/프로그래머스/2/84512. 모음 사전/README.md
new file mode 100644
index 0000000..93c444c
--- /dev/null
+++ b/프로그래머스/2/84512. 모음 사전/README.md
@@ -0,0 +1,80 @@
+# [level 2] 모음 사전 - 84512
+
+[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/84512)
+
+### 성능 요약
+
+메모리: 10.3 MB, 시간: 2.45 ms
+
+### 구분
+
+코딩테스트 연습 > 완전탐색
+
+### 채점결과
+
+정확성: 100.0
합계: 100.0 / 100.0
+
+### 제출 일자
+
+2025년 02월 13일 11:04:06
+
+### 문제 설명
+
+
사전에 알파벳 모음 'A', 'E', 'I', 'O', 'U'만을 사용하여 만들 수 있는, 길이 5 이하의 모든 단어가 수록되어 있습니다. 사전에서 첫 번째 단어는 "A"이고, 그다음은 "AA"이며, 마지막 단어는 "UUUUU"입니다.
+ +단어 하나 word가 매개변수로 주어질 때, 이 단어가 사전에서 몇 번째 단어인지 return 하도록 solution 함수를 완성해주세요.
+ +| word | +result | +
|---|---|
"AAAAE" |
+6 | +
"AAAE" |
+10 | +
"I" |
+1563 | +
"EIO" |
+1189 | +
입출력 예 #1
+ +사전에서 첫 번째 단어는 "A"이고, 그다음은 "AA", "AAA", "AAAA", "AAAAA", "AAAAE", ... 와 같습니다. "AAAAE"는 사전에서 6번째 단어입니다.
+ +입출력 예 #2
+ +"AAAE"는 "A", "AA", "AAA", "AAAA", "AAAAA", "AAAAE", "AAAAI", "AAAAO", "AAAAU"의 다음인 10번째 단어입니다.
+ +입출력 예 #3
+ +"I"는 1563번째 단어입니다.
+ +입출력 예 #4
+ +"EIO"는 1189번째 단어입니다.
+ + +> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges \ No newline at end of file diff --git a/프로그래머스/2/84512. 모음 사전/모음 사전.py b/프로그래머스/2/84512. 모음 사전/모음 사전.py new file mode 100644 index 0000000..c6e6579 --- /dev/null +++ b/프로그래머스/2/84512. 모음 사전/모음 사전.py @@ -0,0 +1,27 @@ +def solution(word): + arr_word = ['A', "E", "I", "O", "U"] + + alphabet_dict={} + + temp = 0 + + + + for i in arr_word: + temp += 1 + alphabet_dict[i] = temp + for j in arr_word: + temp += 1 + alphabet_dict[i+j] = temp + for k in arr_word: + temp += 1 + alphabet_dict[i+j+k] = temp + for l in arr_word: + temp += 1 + alphabet_dict[i+j+k+l] = temp + for m in arr_word: + temp += 1 + alphabet_dict[i+j+k+l+m] = temp + + answer = alphabet_dict[word] + return answer \ No newline at end of file