Skip to content
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

Merged
merged 7 commits into from
May 31, 2024
Merged

[SAM] 5th week solutions #99

merged 7 commits into from
May 31, 2024

Conversation

SamTheKorean
Copy link
Contributor

No description provided.

@DaleSeo
Copy link
Contributor

DaleSeo commented May 28, 2024

선 Draft PR, 후 문제 풀이! 👍

Copy link
Contributor

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

힘내세용~

Comment on lines 1 to 2
# TC : O(n+L) n is the number of strings in strs. L is the total length of all strings combined.
# SC : O(L)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

복잡도 분석을 할 때 문자열의 평균 길이를 기준으로 구하는 것은 봤어도, 모든 문자열의 전체 길이를 기준으로 구하는 것은 처음 봅니다. 어떻게 이러한 분석 결과가 도출되었는지 궁금하네요. 부연 설명이 더 요청드려도 될까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피드백 감사드립니다! 지금 보니 제가 왜 저렇게 접근했는지 이해가 안갈정도로 이상한 분석이네요. 다시 고쳐서 commit하겠습니다!

Comment on lines +29 to +31
# Once we have k elements in the result, return it
if len(res) == k:
return res
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

복잡도에 영향은 주지 않지만 Nice optimization 입니다!

@SamTheKorean SamTheKorean marked this pull request as ready for review May 29, 2024 13:17
Comment on lines 7 to 8
# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

흠... 여전히 복잡도 분석 결과가 좀 난해하게 느껴지는 것 같아요 😅
시간 복잡도와 공간 복잡도를 굳이 다른 기준으로 분석하는 게 어떤 의미가 있고, 면접관 입장에서 어떻게 받아드여질지 대해서 한 번 생각을 해보시면 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

단순히 a list of strings를 순회하는건데 너무 복잡하게 생각했던 것 같습니다. 고쳐서 다시 커밋했습니다! 다시 피드백 감사드립니다!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 파일 왜 비어있죠..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 리트코드에서 풀고 안넣었거나 저장안하고 vscode 종료했나보네요. 추가하고 커밋했습니다!

Copy link
Contributor

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨어용!

@DaleSeo DaleSeo merged commit 6bc19c0 into DaleStudy:main May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants