링크 : https://school.programmers.co.kr/learn/courses/30/lessons/84512
#include <string>
#include <vector>
#include <map>
using namespace std;
vector<string> vowels = {"A", "E", "I", "O", "U"};
map<string, int> dic;
int cnt = 1;
void dfs(string s){
if(s.length() > 5) return;
dic[s] = cnt++;
for(auto v : vowels) dfs(s+v);
}
int solution(string word) {
int answer = 0;
for(auto v : vowels) dfs(v);
return dic[word];
}