Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
유형: 브루트 포스,백트래킹
등급: L2
url: https://school.programmers.co.kr/learn/courses/30/lessons/468377
코드 리뷰
개요
이 코드는 DFS 기반 백트래킹을 통해 각 스테이지에서 힌트 번들을 구매할지 / 구매하지 않을지를 탐색하며 최소 비용을 계산하는 구조로 작성되어 있습니다.
buy[]배열을 통해 미래 스테이지에서 사용할 수 있는 힌트 개수를 관리하고, 번들을 구매했을 때 상태를 변경한 뒤 재귀 호출이 끝나면 다시 복원하는 백트래킹 패턴을 사용하고 있습니다.전체적으로 문제의 핵심 상태를 잘 표현하고 있으며, 탐색 흐름도 명확하게 구성되어 있습니다.
👍 좋은 점
1. 상태 관리가 명확합니다
buy[]배열을 사용하여 각 스테이지가 보유한 힌트 개수를 관리한 점이 좋습니다.