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.
풀이
저는 이 문제를 풀 때 원숭이처럼 풀면 되겠다 생각해서 BFS 로 접근했습니다. 풀다보니 dfs가 더 쉬울 거 같다는 생각이 들긴 했습니다 ㅠ
이 문제를 풀면서 bfs에서 큐에 값을 넣어줄 때, 이전 맵과 방문체크 배열을 함께 보내줘서 처리하도록 했습니다.
여기서 중요한 점은 한번만 깍을 수 있다는 점과, 깍을 때 굳이 많이 깍을 필요없이 이전 방문한 곳의 -1만큼만 깍으면 된다는게 가장 중요한 점인것 같고, 이런 점들을 고려해서 BFS 를 이용해 문제를 풀었습니다~
리뷰 요청 사항
느낀점