public int solution(String word) {
int answer = 0;
int[] lengths = { 781, 156, 31, 6, 1 };
String vowels = "AEIOU";
for (int i = 0; i < word.length(); i++) {
char ch = word.charAt(i);
int index = vowels.indexOf(ch) + 1;
answer += (index - 1) * lengths[i] + 1;
}
return answer;
}
출처:https://school.programmers.co.kr/learn/courses/30/lessons/84512