문제: https://school.programmers.co.kr/learn/courses/30/lessons/84512
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
# 왜 이생각을 못했지?
def solution(word):
answer = []
cnt = 0
def dfs(s,check_list):
nonlocal cnt
if len(s) == 5:
return
for i in check_list:
p = s + i
cnt += 1
if p == word:
answer.append(cnt)
print(p)
break
dfs(p,check_list)
dfs('',['A', 'E', 'I', 'O', 'U'])
return answer[0]
반응형
'공부 서랍장 > 알고리즘 공부' 카테고리의 다른 글
[프로그래머스] 소수 찾기 python (0) | 2022.09.18 |
---|---|
[알고리즘 필수 기법] 조합, 순열 (0) | 2022.09.18 |
[프로그래머스] H-Index python (0) | 2022.09.18 |
[프로그래머스] 성격 유형 검사하기 python (0) | 2022.09.18 |
[프로그래머스] 신고 결과 받기 python (0) | 2022.09.18 |