-
-
Notifications
You must be signed in to change notification settings - Fork 256
[hoyeongkwak] Week 5 Solutions #1851
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.
수고하셨습니다 :)
| if not prices or len(prices) < 2: | ||
| return 0 | ||
| n = len(prices) | ||
| hold = [0] * 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.
불필요하게 O(n) 공간을 사용
group-anagrams/hoyeongkwak.py
Outdated
| class Solution: | ||
| def groupAnagrams(self, strs: List[str]) -> List[List[str]]: | ||
| strResult = {} | ||
| for str in strs: |
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.
변수명 str은 파이썬 내장 타입 str을 덮어씌우므로 지양
| space complexity : O(1) | ||
| ''' | ||
|
|
||
| class TriedNode: |
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.
TriedNode는 아마 TrieNode의 오타일 가능성이 높습니다. 자료구조 네이밍 일관성을 위해 수정하는 것이 좋을 것 같습니다
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!