Merged
Conversation
suhwan2004
approved these changes
Dec 15, 2024
Collaborator
suhwan2004
left a comment
There was a problem hiding this comment.
고생하셨습니다! 저의 경우 DFS로만 풀이를 진행했던지라, BFS로 풀어주신 풀이가 반갑네요 :)
bangdori/Shortest Bridge.js
Outdated
Comment on lines
60
to
63
| nextRow >= 0 && | ||
| nextRow < rows && | ||
| nextCol >= 0 && | ||
| nextCol < cols |
Collaborator
There was a problem hiding this comment.
뭔가, 위에서도 쓰이는지라 만약 함수로 분리한다면 분리할 수 있을 것 같은 느낌이네요
function checkInArr (row, col) {
return row>= 0 &&
row< rows &&
col>= 0 &&
col< cols
}
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.
문제
풀이
ISLAND2)으로 변경한다.WATER)를 탐색하며 확장해 나간다.distance)으로 변환한다.distance)은 두 번째 섬과 동일한 값으로 분류될 수 있기 때문에 음수로 저장한다.ISLAND)에 도달할 때까지 BFS를 반복하며 다리의 길이를 계산한다.어려웠던 점
알게된 점