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/SC를 주석으로 추가하면 이해에 도움이 될 것 같습니다. 예를 들어, climbStairs는 "TC: O(n), SC: O(1)" 등.
코드 가독성 및 스타일: 함수 내부에 주석이 잘 달려있어 이해하기 쉽지만, 일부 변수명(prev1, prev2)은 prev와 curr처럼 좀 더 직관적일 수 있습니다. 또한, productExceptSelf3의 products는 result로 명명하는 것도 고려해보세요.
접근법 제안: productExceptSelf는 brute force보다 prefix-suffix 또는 두 포인터 방식을 사용하는 것이 시간 복잡도면에서 더 좋습니다. 이미 구현하셨지만, 참고로 공간 최적화 버전 (productExceptSelf3)이 가장 효율적입니다.
Unicode 고려: isAnagram2에서 Unicode 안전성을 고려한 점 좋습니다. 만약 확장성을 원하시면, 문자열 길이 체크도 [...s].length로 하는 것도 좋습니다.
일관성 유지: 함수 선언에서 화살표 함수(const foo = () => {})와 전통적인 함수 선언(function foo() {})가 혼합되어 있는데, 일관성을 유지하는 것도 좋습니다.
전반적으로 훌륭한 작업입니다! 다양한 풀이법을 제시해서 학습에 큰 도움이 될 것 같아요. 계속해서 이렇게 깔끔한 정리와 다양한 접근법을 보여주세요!
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 하나 이상을 반드시 검토를 해주셔야 합니다!