Skip to content

[croucs] WEEK 1 #654

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

Merged
merged 7 commits into from
Dec 12, 2024
Merged

[croucs] WEEK 1 #654

merged 7 commits into from
Dec 12, 2024

Conversation

heypaprika
Copy link
Contributor

@heypaprika heypaprika commented Dec 9, 2024

답안 제출 문제

체크 리스트

  • PR을 프로젝트에 추가하고 Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 Status를 In Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@heypaprika heypaprika requested a review from mike2ox December 9, 2024 01:22
@heypaprika heypaprika requested a review from a team as a code owner December 9, 2024 01:22
@github-actions github-actions bot added the py label Dec 9, 2024
@heypaprika heypaprika changed the title ADD : contains-duplicate/heypaprika.py [croucs] WEEK 1 Dec 9, 2024
@obzva
Copy link
Contributor

obzva commented Dec 9, 2024

안녕하세요 :)
간략하게나마 Big O를 써보시는 것 추천드립니다
https://discord.com/channels/775115965964222492/1313636223058972703/1314140425216327731

Copy link
Contributor

@mike2ox mike2ox left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 오랜만에 보는 파이썬이라서 리뷰하는데 난항이 있지 않을까 싶었네요 ㅎㅎ
리뷰하면서 궁금한 것들 코멘트 달아놨습니다 :)

class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
num_dict = {}
for num in nums:
Copy link
Contributor

Choose a reason for hiding this comment

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

입력받은 List는 정렬되지 않은 상태이기 때문에 중복된 요소간의 List내 위치가 많이 멀 경우 시간복잡도가 안좋게 잡힐 가능성이 커서 정렬한 상태에서 비교하는건 어떨까요?

Comment on lines +5 to +8
if len(nums) == 0:
return 0
elif len(nums) == 1:
return 1
Copy link
Contributor

Choose a reason for hiding this comment

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

(사소) nums 길이가 1이하면 sorting하기 전에도 결과를 반환할 수 있어서 가지치기 느낌으로 longestConsecutive 내 최상단에 두면 더 좋아보입니다.

@@ -0,0 +1,11 @@
# Big-O 예상 : O(n*k)
Copy link
Contributor

Choose a reason for hiding this comment

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

안녕하세요 ☺️
일반적으로 Big O 분석을 한다고 하면 해당 풀이의 시간 복잡도와 공간 복잡도를 분석하는 것을 뜻합니다
따라서 해당 Big O 표기가 어느 부분에 관한 분석인지 적어주시는 것이 좋을 것 같아요
또한 Big O 표기에 n, k 이렇게 두 개의 변수가 쓰이고 있는데, 각각의 변수가 어떤 걸 의미하고 있는지 적어주시면 좋을 것 같습니다 ㅎㅎ
위키에 모범 답안제출 사례들을 참고하시길 추천 드립니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네~ 피드백 감사드립니다!!

@heypaprika heypaprika merged commit 895165f into DaleStudy:main Dec 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants