From d2e3dbfe6ecba8ef087c59369ae2516e0f66138f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=A7=84?= Date: Tue, 11 Nov 2025 09:26:21 +0900 Subject: [PATCH] =?UTF-8?q?[20251111]=20PGM=20/=20LV2=20/=20=EB=AA=A8?= =?UTF-8?q?=EC=9D=8C=EC=82=AC=EC=A0=84=20/=20=EA=B9=80=EB=AF=BC=EC=A7=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.md" | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 "zinnnn37/202511/11 PGM LV2 \353\252\250\354\235\214\354\202\254\354\240\204.md" diff --git "a/zinnnn37/202511/11 PGM LV2 \353\252\250\354\235\214\354\202\254\354\240\204.md" "b/zinnnn37/202511/11 PGM LV2 \353\252\250\354\235\214\354\202\254\354\240\204.md" new file mode 100644 index 00000000..b34ad901 --- /dev/null +++ "b/zinnnn37/202511/11 PGM LV2 \353\252\250\354\235\214\354\202\254\354\240\204.md" @@ -0,0 +1,42 @@ +```java +import java.util.ArrayList; +import java.util.List; + +public class PGM_LV2_모음사전 { + + private static final String[] vowels = {"A", "E", "I", "O", "U"}; + + private static int ans; + private static String word; + private static List words; + + private static void dfs(int depth, String tmp) { + if (depth > 5) { + return; + } + + words.add(tmp); + + for (int i = 0; i < 5; i++) { + dfs(depth + 1, tmp + vowels[i]); + } + } + + public int solution(String w) { + word = w; + words = new ArrayList<>(); + + dfs(0, ""); + + int len = words.size(); + for (int i = 0; i < len; i++) { + if (words.get(i).equals(word)) { + ans = i; + break; + } + } + + return ans; + } +} +``` \ No newline at end of file