Skip to content

[minsikpaul92] WEEK 01 Solutions - #2918

Merged
minsikpaul92 merged 5 commits into
DaleStudy:mainfrom
minsikpaul92:week-01
Nov 16, 2026
Merged

minsikpaul92 merged 5 commits into
DaleStudy:mainfrom
minsikpaul92:week-01

Conversation

@minsikpaul92

@minsikpaul92 minsikpaul92 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@dalestudy

dalestudy Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI 리뷰(알고리즘 패턴, 시간/공간 복잡도, 학습 현황) 결과는 Checks 탭에서 볼 수 있어요.

@liza0525
liza0525 self-requested a review November 12, 2026 12:39

@DaleSeo DaleSeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

실제 면접에서는 풀이 후에 시간/공간 복잡도를 풀어보는 경우가 많으니 다른 분들처럼 주석으로 표시하시면 좋을 것 같아요. 그 밖에 몇 가지 사소한 제안을 남겼습니다. 수고하셨습니다!

Comment thread two-sum/minsikpaul92.py Outdated
for i in range (len(nums)):
for j in range(i+1, len(nums)):
if target == nums[i] + nums[j]:
return [i, j] No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

파일 끝에 줄바꿈이 없어서 linelint 체크가 실패하고 있어요. 마지막 줄 뒤에 빈 줄 하나만 추가해 주세요.

Comment thread two-sum/minsikpaul92.py Outdated
Comment on lines +3 to +6
for i in range (len(nums)):
for j in range(i+1, len(nums)):
if target == nums[i] + nums[j]:
return [i, j] No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

이중 반복문이라 O(n^2) 시간이 걸리는데, contains-duplicate 문제에서 하셨던 것처럼 지나온 값을 저장해 두면 한 번만 순회해서 풀 수 있지 않을까요?

Comment thread two-sum/minsikpaul92.py
@@ -0,0 +1,6 @@
class Solution:
def twoSum(self, nums: list[int], target: int) -> list[int]:
for i in range (len(nums)):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

range와 괄호 사이에 공백이 있네요. PEP 8에서는 함수 호출 괄호 앞에 공백을 두지 않습니다.

@liza0525 liza0525 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다! 의견 하나만 작성하고 갑니다

Comment thread two-sum/minsikpaul92.py Outdated
for i in range (len(nums)):
for j in range(i+1, len(nums)):
if target == nums[i] + nums[j]:
return [i, j] No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

소소한 의견 하나 드리고 갑니다!

현재는 if문에서 early return을 하고 있는데
마지막에 기본 return을 두면 좋을 것 같습니다 :)
(예시: return [] # 정답을 못 찾은 경우)

You may assume that each input would have exactly one solution, and you may not use the same element twice.

위 문장처럼 현재 문제에 무조건 하나의 정답은 나온다는 조건이 있어서
지금 코드대로 작성하셔도 무방합니다만,
(제가 C++로 문제 풀다보니) 습관적으로 쓰면 좋겠다는 생각이 급 들었습니다
실제로 파이썬으로 실무할 때 return을 빼먹어서 버그 대응 시 어려웠던 기억이 떠올랐고요
(파이썬은 return이 없다고 해서 에러가 나지 않기에 더더욱...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

의견 감사합니다!!

@parkhojeong

parkhojeong commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

@minsikpaul92 ci 실패와 다른 분들께서 남겨주신 커멘트들 확인 부탁드립니다.

@minsikpaul92
minsikpaul92 marked this pull request as ready for review November 16, 2026 00:53
@minsikpaul92
minsikpaul92 merged commit 87bdeec into DaleStudy:main Nov 16, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Solving to Completed in 리트코드 스터디 9기 Nov 16, 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.

4 participants