From 7b8076315ae420a2762ce28c32a916649574931d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=8B=A0=EC=A7=80?= <101992179+ksinji@users.noreply.github.com> Date: Sun, 2 Nov 2025 17:46:39 +0900 Subject: [PATCH] =?UTF-8?q?[20251102]=20PGM=20/=20LV2=20/=20=EB=AA=A8?= =?UTF-8?q?=EC=9D=8C=EC=82=AC=EC=A0=84=20/=20=EA=B0=95=EC=8B=A0=EC=A7=80?= 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" | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 "ksinji/202511/2 PGM \353\252\250\354\235\214\354\202\254\354\240\204.md" diff --git "a/ksinji/202511/2 PGM \353\252\250\354\235\214\354\202\254\354\240\204.md" "b/ksinji/202511/2 PGM \353\252\250\354\235\214\354\202\254\354\240\204.md" new file mode 100644 index 00000000..b1f0dd27 --- /dev/null +++ "b/ksinji/202511/2 PGM \353\252\250\354\235\214\354\202\254\354\240\204.md" @@ -0,0 +1,28 @@ +```java +class Solution { + static final char[] V = {'A','E','I','O','U'}; + static int answer = 0; + static boolean equal = false; + + void dfs(String cur, String target){ + if (equal) return; + if (!cur.isEmpty()){ + answer++; + + if (cur.equals(target)){ + equal = true; + return; + } + } + if (cur.length() == 5) return; + for (char c : V){ + dfs(cur+c, target); + } + } + + public int solution(String word) { + dfs("", word); + return answer; + } +} +```