Skip to content

Conversation

@geegong
Copy link
Contributor

@geegong geegong commented Nov 15, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@geegong
Copy link
Contributor Author

geegong commented Nov 15, 2025

@DaleStudy 리뷰해줘

@dalestudy
Copy link
Contributor

dalestudy bot commented Nov 15, 2025

Great job on submitting solutions for multiple problems! Your code demonstrates solid understanding and thoughtful optimizations, especially with the use of HashSets, HashMaps, and sorting. Here are some constructive suggestions to enhance your code further:

  1. Time & Space Complexity Annotations:
    For each solution, include explicit TC/SC comments. For example, in your longestConsecutive, note TC: O(N log N), SC: O(N) due to sorting and set operations. This helps reviewers quickly grasp efficiency.

  2. Algorithm Improvements:

    • Longest Consecutive Sequence:
      Sorting works, but a more optimal approach is to use a HashSet to achieve O(N) by only starting sequences at numbers that are sequence starters (i.e., num - 1 not in set). This reduces complexity from O(N log N) to O(N).
    • Top K Frequent Elements:
      You’ve used sorting by frequency which is good. Alternatively, for large datasets, a bucket sort approach can achieve O(N) without sorting, by placing elements into buckets based on frequency.
  3. Readability & Style:

    • Keep consistent commenting style. For example, avoid commented-out code unless essential; it can clutter the final version.
    • Use descriptive variable names (e.g., mapsvalueToIndexMap) for clarity.
    • Consider adding brief method comments summarizing approach and complexity.
  4. Code Robustness:

    • In longestConsecutive, handle empty input gracefully at the start.
    • In twoSum, your current logic is correct but adding a comment about the assumption that exactly one solution exists (as per problem constraints) can be helpful.
  5. Encouragement:
    Your solutions are well-structured and thoughtful. Keep exploring different approaches—like bucket sort for frequency problems—to deepen your understanding. Your consistent style and optimization effort are commendable!

Overall, you're doing an excellent job. Incorporate these suggestions gradually, and your code will become even more efficient and maintainable. Keep up the great work!

Copy link
Contributor

@Donghae0230 Donghae0230 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요~ 첫주차 문제 풀이 정말 고생많으셨어요😀
리뷰가 늦었지만 주석과 관련해 몇가지 의견 남겨보았습니다!

@geegong geegong merged commit 936af59 into DaleStudy:main Nov 16, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 6기 Nov 16, 2025
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