https://school.programmers.co.kr/learn/courses/30/lessons/84512
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
import java.util.*;
class Solution {
static char[]alph = {'A','E','I','O','U'};
static List<String> list;
public int solution(String word) {
list= new ArrayList<>();
combination(0,"");
Collections.sort(list);
return list.indexOf(word)+1;
}
public void combination(int idx, String str){
if(idx>=5) return;
for(int i=0; i<alph.length; i++){
list.add(str+alph[i]);
combination(idx+1, str+alph[i]);
}
}
}
'코테풀이' 카테고리의 다른 글
[프로그래머스] 피로도 java (LEVEL2) (0) | 2023.04.30 |
---|---|
[프로그래머스] 전력망을 둘로 나누기 java (LEVEL2) (0) | 2023.04.30 |
[프로그래머스] 전화번호 목록 java 자바 (LEVEL2) (0) | 2023.04.30 |
[프로그래머스] 의상 java 자바(LEVEL2) (0) | 2023.04.30 |
[프로그래머스] 달리기 경주 java 풀이(level1) (0) | 2023.04.20 |