Skip to content

[OstenHun] WEEK 01 solutions #2385

Merged
OstenHun merged 1 commit intoDaleStudy:mainfrom
OstenHun:main
Mar 8, 2026
Merged

[OstenHun] WEEK 01 solutions #2385
OstenHun merged 1 commit intoDaleStudy:mainfrom
OstenHun:main

Conversation

@OstenHun
Copy link
Member

@OstenHun OstenHun commented Mar 6, 2026

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@github-actions github-actions bot added the c++ label Mar 6, 2026
@OstenHun OstenHun requested review from a team and removed request for a team March 6, 2026 15:13
@DaleStudy DaleStudy deleted a comment from dalestudy bot Mar 6, 2026
@devdays9 devdays9 self-requested a review March 6, 2026 15:41
@OstenHun OstenHun moved this from Solving to In Review in 리트코드 스터디 7기 Mar 7, 2026
@OstenHun
Copy link
Member Author

OstenHun commented Mar 8, 2026

@DaleStudy 리뷰해줘

@dalestudy
Copy link
Contributor

dalestudy bot commented Mar 8, 2026

우선, 문제 해결을 위해 여러 접근법을 시도하며 점진적으로 개선한 모습이 인상적입니다. 특히, 마지막에는 해시셋을 활용한 최적화된 방법을 도입한 점이 좋습니다. 몇 가지 피드백 드리자면:

  1. 시간/공간 복잡도 명시: 마지막 구현에 TC: O(n), SC: O(n)으로 명시하는 것을 추천합니다. 이는 코드의 효율성을 이해하는 데 도움됩니다.

  2. 가독성 및 스타일: 마지막 버전에서는 nums.reserve(n);를 사용하여 메모리 할당을 최적화한 점이 좋습니다. 다만, using namespace std;는 가능하면 피하는 것이 더 좋은 습관입니다. 대신 std::를 명시하는 것도 가독성에 도움이 됩니다.

  3. 코드 정리: 불필요한 주석이나 이전 방법에 대한 설명은 제거하거나 별도 문서로 정리하는 것이 깔끔합니다. 제출 시에는 마지막 깔끔한 버전만 남기고, 필요하면 깃허브의 커밋 메시지 또는 문서로 설명하는 것이 좋습니다.

  4. 추가 제안: C++20 이상에서는 std::unordered_set 대신 std::unordered_setcontains() 메서드(구버전은 count() 혹은 find()를 사용) 활용도 고려할 수 있습니다.

전체적으로, 여러 방법을 실험하며 최적의 솔루션에 도달하는 과정이 훌륭하며, 마지막 버전은 깔끔하고 효율적입니다. 앞으로도 다양한 데이터 구조와 알고리즘을 실험하는 태도를 유지하세요!

@OstenHun
Copy link
Member Author

OstenHun commented Mar 8, 2026

@DaleStudy 승인

Copy link
Contributor

@dalestudy dalestudy bot left a comment

Choose a reason for hiding this comment

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

승인되었습니다! 👍

@OstenHun OstenHun merged commit 4759a12 into DaleStudy:main Mar 8, 2026
3 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 7기 Mar 8, 2026
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.

1 participant