import java.util.*;
class Solution {
static String p = "";
static char[] w = {'A','E','I','O','U'};
static ArrayList<String> list = new ArrayList<>();
public int solution(String word) {
permutation(0);
Collections.sort(list);
int answer = list.indexOf(word)+1;
return answer;
}
static void permutation(int L){
if(L==w.length){
return;
}
for(int i=0;i<w.length;i++){
p += w[i];
list.add(p);
permutation(L+1);
p = p.substring(0,L);
}
}
}
list: 중복순열(dfs)의 모든 경우의 수를 저장하기 위한 리스트
중복 순열 돌면서 모든 경우의 수 list에 add
list 정렬