-
-
Notifications
You must be signed in to change notification settings - Fork 195
[bhyun-kim, 김병현] Week 4 solutions #88
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
- Append the sum to the output list | ||
- Return the output list | ||
|
||
Time complexity: O(nlogn) |
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.
확실히 이 문제는 보통 nlog(n)으로 먼저 푸시는 분들이 많군요.
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.
그렇군요. 즉석에서 풀려고 하면 쉽지 않을 것 같으니 여러가지 풀이를 연습해야겠습니다.
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.
Dynamic Programming을 이용해서
group-anagrams/bhyun-kim.py
Outdated
for s in strs: | ||
count_s = "".join(sorted(s)) | ||
if count_s in hash_table: | ||
idx = hash_table.index(count_s) |
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.
내장함수를 사용할 때 특히 반복문에 넣을 때는 �함수 내부의 시간복잡도 분석이 중요할 것 같습니다.
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.
Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
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.
내장함수 메서드별로 시간복잡도도 머릿속에 넣어두는게 좋겠군요! 고생하셨습니다!
No description provided.