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; + } +} +```