[river20s] WEEK 08 solutions#1507
Merged
river20s merged 4 commits intoDaleStudy:mainfrom May 24, 2025
Merged
Conversation
- 룩업 테이블 사용하여 follow up 질문 답안 작성해보았습니다. - 기본적인 비트 연산자 사용해서 순회하며 뒤집는 로직을 기본으로 두었습니다.
…udy#244 - 슬라이딩 윈도우를 적용하여 답안을 작성했습니다.
- 원본 노드 객체를 key로, 복사본 노드 객체를 value로 갖는 clones_map을 사용해 이미 복제되었는지 체크하도록 합니다. - DFS를 활용해 재귀적으로 깊은 복사를 수행하는 dfs_clone() 함수를 작성했습니다. clones_map에 지금 보고 있는 원본 노드가 있다면 바로 복사본 노드를 반환합니다. - 새 노드를 만들고 val을 복사한 후, 곧바로 clones_map에 매핑하도록 하여 무한 루프를 방지했습니다.(그래프가 연결되어 있어, 이웃을 복제하다가 계속해서 재귀 호출하는 경우 방지)
- 브루트 포스로 구현하였다가, 복잡도가 O(n^3)이 되어 해설을 보고 최적화 하였습니다.
Moonjonghoo
approved these changes
May 24, 2025
Contributor
Moonjonghoo
left a comment
There was a problem hiding this comment.
주석과함께 깔끔하게 정리해주셔서 언어가 달라도 이해하기 편했습니다.
한주간 고생하셧습니다!
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.
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!