-
-
Notifications
You must be signed in to change notification settings - Fork 305
[8804who] WEEK 01 solutions #2014
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
Conversation
youngDaLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| @@ -0,0 +1,4 @@ | |||
| class Solution: | |||
| def containsDuplicate(self, nums: List[int]) -> bool: | |||
| return len(set(nums)) != len(nums) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
한줄코딩 깔끔하네요 👍
| else: | ||
| num_list[num] += 1 | ||
|
|
||
| return [n[1] for n in sorted([[num_list[key], key] for key in num_list.keys()], reverse=True)[:k]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heapq.nlargest 사용을 고려할 수도 있을 것 같습니다!
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!