-
-
Notifications
You must be signed in to change notification settings - Fork 195
[printjin-gmailcom] Week 05 Solutions #1378
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
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.
빨리 푸셨네요 👍🏻
def groupAnagrams(self, strs): | ||
anagrams = defaultdict(list) | ||
for word in strs: | ||
count = [0] * 26 |
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.
오.. 문자 개수 기반으로 그룹화 하는 부분이 인상깊네요.
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.
시간 복잡도만 보면 카운트 방식이 더 빠를 거라고 생각했는데, 리트코드에서는 문자열을 정렬하는 방법이 더 빠르더라고요. 아마 테스트에 사용된 단어들이 짧아서 그런 것 같습니다만 효율적인 방법 공유해보고자 최종코드로 넣었어요 :)
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!