문제: https://school.programmers.co.kr/learn/courses/30/lessons/84512
# 왜 이생각을 못했지?
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 |