Skip to content
Merged
Changes from 1 commit
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
18 changes: 18 additions & 0 deletions contains-duplicate/jongwanra.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

"""
[문제]
https://leetcode.com/problems/contains-duplicate/description/

[문제 접근 방법]
Set 자료구조를 활용하여 중복 여부를 개수로 확인한다.

[Complexity]
Copy link
Contributor

Choose a reason for hiding this comment

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

주어진 입력이 set으로 전환되는 비용에 대해 조금 더 구체적인 설명이 있으면 좋을 것 같아요!

N: nums 길이
TC: O(N)
SC: O(N)
"""

class Solution(object):
def containsDuplacate(self, nums):
num_set = set(nums)
return len(num_set) != len(nums)
Loading