Skip to content

Conversation

@chjung99
Copy link
Contributor

답안 제출 문제

작성자 체크 리스트

  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@chjung99
Copy link
Contributor Author

Week 설정 추가

@chjung99
Copy link
Contributor Author

@DaleStudy 리뷰해줘

@dalestudy
Copy link
Contributor

dalestudy bot commented Nov 15, 2025

Great job on submitting multiple solutions across different problems! Your code demonstrates solid understanding and implementation of dynamic programming, linked list manipulation, tree traversal, hash maps, and stack usage. Here are some suggestions to improve your code further:

  1. Time & Space Complexity Comments:

    • Including brief complexity annotations (e.g., // TC: O(n), SC: O(1)) will help clarify your solutions' efficiency and assist future reviewers or debugging efforts.
  2. Climbing Stairs (climbStairs):

    • Your DP approach is correct. To optimize space, consider using two variables instead of an array, reducing space complexity from O(n) to O(1).
    • Example: int prev = 1, curr = 1; then update iteratively.
  3. Merge Two Sorted Lists:

    • Your current approach creates new nodes and assigns values, which can be simplified by using a dummy head node and directly manipulating pointers. This reduces the need for explicit value assignments and improves readability.
    • Also, consider handling edge cases at the start to avoid unnecessary null checks inside the loop.
  4. Same Tree Check:

    • Using serialization with null markers is valid, but a recursive comparison of nodes could be more straightforward and efficient.
    • For example, a simple recursive method: compare current nodes, then recurse on left and right.
  5. Two Sum:

    • Your approach of storing indices in a HashMap is good. To improve, you could handle the case where nums[i] * 2 == target more explicitly to avoid index errors or duplication.
    • Alternatively, a single-pass solution checking complement on the fly can be more concise.
  6. Valid Parentheses:

    • Your stack-based method is clear and efficient. To enhance readability, consider using a HashMap to map closing to opening brackets, reducing multiple if statements.

Overall, your code is well-structured with clear logic. Fine-tuning with comments, optimizing space where possible, and simplifying some logic will make your solutions even more elegant. Keep up the great work—you're making excellent progress!

@jun-brro jun-brro self-requested a review November 15, 2025 11:14
@jun-brro
Copy link
Contributor

good code! merge-two-sorted-lists에서 tail pointer 옮겨가는 방식은 처음보는 접근이라 인상적입니다!

@chjung99 chjung99 merged commit 1e94a94 into DaleStudy:main Nov 15, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 6기 Nov 15, 2025
@chjung99
Copy link
Contributor Author

good code! merge-two-sorted-lists에서 tail pointer 옮겨가는 방식은 처음보는 접근이라 인상적입니다!

리뷰 감사합니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants