Skip to content

Commit 1e822ef

Browse files
committed
contains-duplicate solution
1 parent 53ce7c7 commit 1e822ef

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

contains-duplicate/jongwanra.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
"""
3+
[문제]
4+
https://leetcode.com/problems/contains-duplicate/description/
5+
6+
[문제 접근 방법]
7+
Set 자료구조를 활용하여 중복 여부를 개수로 확인한다.
8+
9+
[Complexity]
10+
N: nums 길이
11+
TC: O(N)
12+
SC: O(N)
13+
"""
14+
15+
class Solution(object):
16+
def containsDuplacate(self, nums):
17+
num_set = set(nums)
18+
return len(num_set) != len(nums)

0 commit comments

Comments
 (0)