diff --git "a/LiiNi-coder/202512/15 PGM \353\252\250\354\235\214\354\202\254\354\240\204.md" "b/LiiNi-coder/202512/15 PGM \353\252\250\354\235\214\354\202\254\354\240\204.md" new file mode 100644 index 00000000..95ce627b --- /dev/null +++ "b/LiiNi-coder/202512/15 PGM \353\252\250\354\235\214\354\202\254\354\240\204.md" @@ -0,0 +1,34 @@ +```java +import java.util.*; + +class Solution { + private static final char[] VOWELS = {'A','E','I','O','U'}; + private static List dict; + + public int solution(String word) { + dict = new ArrayList<>(); + dfs(""); + + for(int i = 0; i < dict.size(); i++){ + if(dict.get(i).equals(word)){ + return i + 1; + } + } + return 0; + } + + private void dfs(String cur){ + if(cur.length() > 0){ + dict.add(cur); + } + if(cur.length() == 5){ + return; + } + + for(int i = 0; i < 5; i++){ + dfs(cur + VOWELS[i]); + } + } +} + +```