https://school.programmers.co.kr/learn/courses/30/lessons/131127
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
def solution(want, number, discount):
answer = 0
dic = dict(zip(want, number))
for i in range(len(discount)-9):
dic_copy = dic.copy()
boo = True
for j in discount[i:i+10]:
if j in want and dic_copy[j] > 0:
dic_copy[j] -= 1
else:
boo = False
break
if boo == True:
answer += 1
return answer'코딩테스트 > 코딩테스트 문제풀이' 카테고리의 다른 글
| [Python] 프로그래머스 <게임 맵 최단거리> (0) | 2025.05.19 |
|---|---|
| [Python] 백준 <1260-DFS와 BFS> (0) | 2025.05.19 |
| [Python] 프로그래머스 <구명보트> (0) | 2025.05.12 |
| [Python] 프로그래머스 <JadenCase 문자열 만들기> (0) | 2025.05.11 |
| [Python] 백준 <1449-수리공 항승> (0) | 2025.05.10 |