-
Notifications
You must be signed in to change notification settings - Fork 126
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
[SAM] 5th week solutions #99
Conversation
선 Draft PR, 후 문제 풀이! 👍 |
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.
힘내세용~
# TC : O(n+L) n is the number of strings in strs. L is the total length of all strings combined. | ||
# SC : O(L) |
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.
피드백 감사드립니다! 지금 보니 제가 왜 저렇게 접근했는지 이해가 안갈정도로 이상한 분석이네요. 다시 고쳐서 commit하겠습니다!
# Once we have k elements in the result, return it | ||
if len(res) == k: | ||
return res |
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.
복잡도에 영향은 주지 않지만 Nice optimization 입니다!
# TC : O(n*m) where n is the length of strings in strs. m is the average length of the strings | ||
# SC : O(S), where S is the sum of the lengths of all strings 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.
흠... 여전히 복잡도 분석 결과가 좀 난해하게 느껴지는 것 같아요 😅
시간 복잡도와 공간 복잡도를 굳이 다른 기준으로 분석하는 게 어떤 의미가 있고, 면접관 입장에서 어떻게 받아드여질지 대해서 한 번 생각을 해보시면 좋을 것 같습니다.
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.
단순히 a list of strings를 순회하는건데 너무 복잡하게 생각했던 것 같습니다. 고쳐서 다시 커밋했습니다! 다시 피드백 감사드립니다!
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.
오 리트코드에서 풀고 안넣었거나 저장안하고 vscode 종료했나보네요. 추가하고 커밋했습니다!
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.