https://school.programmers.co.kr/learn/courses/30/lessons/84512
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
CHARS = 'AEIOU'
def dfs(states, words):
if len(states) == 5:
return
for c in CHARS:
states.append(c)
words.append(''.join(states))
dfs(states, words)
states.pop()
def solution(word):
states, words = [], []
dfs(states, words)
return words.index(word) + 1
# 만들 수 있는 모든 조합을 words 리스트에 넣고 인덱스로 조회
'프로그래머스' 카테고리의 다른 글
프로그래머스 42840. 모의고사 (0) | 2024.11.16 |
---|---|
프로그래머스 77486. 다단계 칫솔 판매 (0) | 2024.11.05 |
프로그래머스 43236. 징검다리 (0) | 2024.11.03 |
프로그래머스 42586. 기능개발 (0) | 2023.11.15 |
프로그래머스 92341. 주차 요금 계산 (0) | 2023.11.09 |