You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
전체적으로 다양한 문제를 잘 해결하셨고, 명확한 변수명과 깔끔한 구조가 돋보입니다! 몇 가지 개선 포인트와 학습 팁을 드리자면:
시간/공간 복잡도 명시 요청: 각 솔루션에 # TC: O(...) SC: O(...)를 추가하시면, 리뷰어와 향후 참고에 도움이 됩니다. 예를 들어, 이진 트리 BFS는 # TC: O(n), SC: O(n)이 적절하겠네요.
이진트리 레벨 오더 탐색 (levelOrder): BFS 구현이 깔끔하며, 딕셔너리 대신 리스트를 사용하는 것도 고려할 수 있습니다. 딕셔너리 대신 리스트 인덱스로 깊이별 결과를 저장하는 것도 직관적입니다.
Counting Bits: 현재는 각 숫자별로 문자열 변환 후 1의 개수 세기인데, 이는 O(log n)이지만, 더 효율적인 방법(예: Brian Kernighan's Algorithm)을 사용할 수도 있습니다. 또한, while (base <= n) 부분이 n보다 작은 수까지만 반복하는데, 이 경우 n이 크면 불필요한 반복이 될 수 있습니다. 더 최적화된 방법도 참고해보세요.
House Robber II: 두 배열을 만들어서 사용하는 방법이 명확하며, 점화식도 적절합니다. 배열을 인플레이션하는 대신, 두 포인터만 사용하는 방법도 고려할 수 있어요.
Lowest Common Ancestor (BST): 반복문이 명확하며, 조건도 적절합니다. guard let p, let q else { return nil } 문법이 깔끔하고 좋습니다.
Meeting Rooms II: 힙을 활용한 풀이가 적절하고, 효율적입니다. intervals.sort()와 힙을 사용하는 방식이 표준적이고 이해하기 쉽습니다.
전반적으로 깔끔하고 읽기 쉬운 코드들이며, 약간의 추가 설명이나 최적화로 더욱 완성도를 높일 수 있습니다. 계속해서 좋은 문제 해결력 보여주세요!
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
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 하나 이상을 반드시 검토를 해주셔야 합니다!