Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HodaeSsi] Week 02 #762

Merged
merged 6 commits into from
Dec 21, 2024
Merged

[HodaeSsi] Week 02 #762

merged 6 commits into from
Dec 21, 2024

Conversation

HodaeSsi
Copy link
Contributor

@HodaeSsi HodaeSsi commented Dec 21, 2024

답안 제출 문제

체크 리스트

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

@HodaeSsi HodaeSsi requested review from EgonD3V and eunhwa99 December 21, 2024 13:09
@HodaeSsi HodaeSsi requested a review from a team as a code owner December 21, 2024 13:09
@github-actions github-actions bot added the py label Dec 21, 2024
@EgonD3V EgonD3V changed the title [HodaeSsi] Week 03 [HodaeSsi] Week 02 Dec 21, 2024
Copy link
Contributor

@EgonD3V EgonD3V left a comment

Choose a reason for hiding this comment

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

2주차 수고 많으셨습니다 화이팅

Comment on lines +3 to +4
answerSet = set()
nums.sort()
Copy link
Contributor

Choose a reason for hiding this comment

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

정렬은 강력한 조건이기 때문에 set을 사용하지 않고 인덱스를 사용해서 중복을 제거하는 방법도 이용해볼 수 있습니다

leftIdx = leftIdx + 1
rightIdx = rightIdx - 1

return list(answerSet)
Copy link
Contributor

Choose a reason for hiding this comment

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

그러면 여기서 set을 list로 돌리지 않아도 될 것 같습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오 안그래도 시간 제한에 아슬아슬한 풀이라 고민 중이었는데,
반영해서 다시 풀어보겠습니다.
리뷰 감사합니다!

Comment on lines +3 to +6
dp = []
dp.append(0)
dp.append(1)
dp.append(2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
dp = []
dp.append(0)
dp.append(1)
dp.append(2)
dp = [0, 1, 2]

이게 더 깔끔할 것 같아서 제안드립니다

for i in range(3, n + 1):
dp.append(dp[i - 1] + dp[i - 2])

return dp[n]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return dp[n]
return dp[-1]

파이썬에서는 이렇게 하면 배열 마지막 원소라는 점이 명확해서 가독성에 도움이 됩니다

Comment on lines +10 to +11
continue
if s[idx] == '0':
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 if-elif-else 구문이 많으면 논리적으로 분리되는 지점에 나눠주시면 가독성에 도움이 됩니다

tLetterDict = {}

for letter in s:
sLetterDict[letter] = sLetterDict.get(letter, 0) + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

기본 메서드를 활용한 깔끔한 라인이 좋습니다

@HodaeSsi HodaeSsi requested a review from donghyeon95 December 21, 2024 14:00
@HodaeSsi HodaeSsi merged commit 8f45cfd into DaleStudy:main Dec 21, 2024
1 check passed
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