Skip to content

Conversation

@Donghae0230
Copy link
Contributor

@Donghae0230 Donghae0230 commented Nov 19, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@Donghae0230 Donghae0230 moved this from Solving to In Review in 리트코드 스터디 6기 Nov 22, 2025
@Donghae0230
Copy link
Contributor Author

@DaleStudy

@dalestudy
Copy link
Contributor

dalestudy bot commented Nov 22, 2025

전체적으로 잘 구조화된 코드와 명확한 주석이 인상적입니다! 특히 각 문제마다 시간 및 공간 복잡도도 정리해두어 이해에 도움이 됩니다. 몇 가지 개선 포인트와 격려를 드리자면:

  1. 복잡도 표기와 정확성:
    climbing-stairs의 경우, 공간 복잡도는 현재 O(n)이지만, 현재 구현은 리스트에 결과를 저장하는 방식이므로 맞습니다. 그러나 최적화할 수 있는데, O(1) 공간을 위해 두 변수만 사용하는 방식도 고려해보세요.
    product-of-array-except-self에서는, 두 리스트(prefix, suffix)를 생성하는데, 이는 명확하지만, 공간 복잡도를 최적화하려면 result에 바로 계산하는 방법도 있습니다.

  2. 개선 제안:

    • climbStairs는 DP 대신에 O(1) 공간으로 해결 가능하며, 이는 더 깔끔하고 효율적입니다.
    • productExceptSelf는 두 개의 리스트를 사용하는 대신, 왼쪽과 오른쪽 곱을 계산하는 변수만 두어 공간을 줄일 수 있습니다. 더 나은 방법을 찾는 연습도 추천합니다.
  3. 가독성 및 스타일:

    • if n == 1, elif n == 2 대신 if n <= 2로 처리하면 조금 더 간결합니다.
    • result.append(...) 대신 초기 크기 할당 후 인덱스로 채우기 방식을 사용할 수도 있습니다.
    • sorted(list(s)) 대신 collections.Counter 또는 dict를 활용한 방법도 고려해보세요.
  4. 코드 리뷰 격려:
    전반적으로 깔끔하게 작성했고, 설명도 잘 되어 있어 읽기 쉽습니다. 앞으로 더 효율적이고 최적화된 방법을 탐구하면서 연습을 계속하세요! 이와 같은 노력이 좋은 결과로 이어질 거예요.

Copy link
Contributor

@kimjunyoung90 kimjunyoung90 left a comment

Choose a reason for hiding this comment

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

생각의 변화의 흐름도 볼 수 있고 다른 풀이방법도 볼 수 있어서 좋았습니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

오 정렬을 해서 풀었군요.
이해하기 쉽네요.

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