Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions contains-duplicate/codyman0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
https://leetcode.com/problems/contains-duplicate/
"""

# Time complexity : O(n)

class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
sortedArray = sorted(nums)
for i in range(len(sortedArray)):
if i == len(sortedArray) - 1:
return False
if sortedArray[i] == sortedArray[i + 1] :
return True
return False
Copy link
Contributor

Choose a reason for hiding this comment

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

추가 문제풀이에 앞서 라인브레이크 설정 부탁드립니다! 보시면 현재 파일 맨 아래 빨간색 원 표시가 보이실거예요! 해당부분 수정 및 남은 4문제는 추가해서 커밋 부탁드리겠습니다 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵!