[20250912] PGM / LV2 / 비밀 코드 해독 / 김수연 #877
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://school.programmers.co.kr/learn/courses/30/lessons/388352
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
1부터 n까지의 서로 다른 정수 5개가 오름차순으로 정렬된 비밀 코드를 가지고 있고, 이 비밀 코드를 맞혀야 함
m번의 시도마다 서로 다른 5개의 정수를 입력하면, 그 중 몇 개가 비밀 코드에 포함되어 있는지 알려줄 때,
비밀 코드로 가능한 정수 조합의 개수 구하기
🔍 풀이 방법
단순 dfs
dfs로 가능한 경우들을 list에 저장해두고, size가 5가 되면
check함수를 통해서 m번의 시도에 부합하는 숫자 조합인지 확인함
⏳ 회고
뭔가 복잡하게 생각했는데 단순했음