Skip to content

Conversation

@ZetBe
Copy link
Contributor

@ZetBe ZetBe commented Nov 26, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

Copy link
Contributor

@radiantchoi radiantchoi 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.

저는 두 함수를 분리하고 싶다는 생각 때문에 파라미터가 많이 늘었는데, 파이썬의 특성상 이렇게 그냥 함수 하나 안에서 nested function을 정의해서 하면 그것도 괜찮겠구나 라는 생각도 들었습니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

실제 문자열을 붙이기보다 경우의 수가 될 수 있는 것만 하나하나 체크해서, n번째 인덱스에 있는 글자까지 체크해본 결과 이 정도 경우의 수가 나왔다~ 하는 풀이로군요! 저는 이번 주에 못 푼 문제인데, 재귀를 통해 직접 문자열을 만들어 봄으로써 해결해보려고 했던 기억이 납니다. DP는 정말 생각지도 못한 곳에서 튀어나오네요.

Copy link
Contributor

Choose a reason for hiding this comment

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

저는 냅다 bin(n[2:]) 해서 나온 문자열에서 1을 셌습니다만, 사실 지금 풀어주신 이 방법이 정석에 가깝다고 생각합니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

이것도 저는 처음 풀 때 dp인지 몰랐는데, dp 배열을 생성하고 i번째 원소까지 고려했을 때의 최댓값을 저장한다 치면 dp라고 볼 수도 있겠더라고요. for문 1회 순회 방식으로 최적화가 될 수도 있었겠습니다만, 시간복잡도와 공간복잡도가 크게 달라지지는 않으므로 괜찮은 듯 합니다.

@ZetBe
Copy link
Contributor Author

ZetBe commented Nov 29, 2025

안녕하세요 경민님, 리뷰 감사합니다!

리뷰해주신 덕분에 이 pr은 merge하겠습니다

@ZetBe ZetBe merged commit 41df393 into DaleStudy:main Nov 29, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 6기 Nov 29, 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