Skip to content

Conversation

yolophg
Copy link
Contributor

@yolophg yolophg commented Dec 13, 2024

답안 제출 문제

체크 리스트

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

@yolophg yolophg requested a review from forest000014 December 13, 2024 07:01
@github-actions github-actions bot added the py label Dec 13, 2024
@yolophg yolophg force-pushed the main branch 2 times, most recently from 93f6e8c to de844cf Compare December 13, 2024 07:11
Copy link
Contributor

@forest000014 forest000014 left a comment

Choose a reason for hiding this comment

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

깔끔하게 풀이해주셔서 추가로 드릴만한 코멘트는 없습니다 (제가 파이썬을 잘 모르기도 하구요.. 😵)
House Robber 풀이도 올려주시면 리뷰하겠습니다

# counts.get gets the count of num
# reverse=True sorts in descending order
# [:k] gets the first k elements
top_nums = sorted(counts, key=counts.get, reverse=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

파이썬에서는 딕셔너리에 대해 sorted를 쓸 수 있군요! 덕분에 자바의 TreeMap 자료구조에 대해서도 공부해볼 수 있었습니다 (비록 이 문제에는 적용하기 어렵지만 ㅎㅎ)

Comment on lines +12 to +20
# only start counting if it's the beginning of a sequence
if num - 1 not in num_set:
current_num = num
current_streak = 1

# keep counting while the next number in the sequence exists
while current_num + 1 in num_set:
current_num += 1
current_streak += 1
Copy link
Contributor

Choose a reason for hiding this comment

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

연속 수열의 시작부터 보는 방법이 있었네요
저는 괜히 어렵게 생각했네요 😅 좋은 아이디어 배우고 갑니다!

@DaleSeo
Copy link
Member

DaleSeo commented Dec 14, 2024

@yolophg 님, 재수생 티나요 😛 우리 3기 부터는 Draft PR 안 쓰기로 했습니다. 프로젝트의 상태로 충분히 커뮤니케이셔니 가능한 부분이라서요.

@SamTheKorean SamTheKorean marked this pull request as ready for review December 15, 2024 21:18
@SamTheKorean SamTheKorean requested a review from a team as a code owner December 15, 2024 21:18
@SamTheKorean SamTheKorean merged commit 0f9a77f into DaleStudy:main Dec 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

5 participants