Skip to content

Commit 8972696

Browse files
Update Contains Duplicate.py
1 parent fcf6841 commit 8972696

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: Arrays/Easy/Contains Duplicate.py

+5
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ def containsDuplicate(self, nums: List[int]) -> bool:
88
else:
99
dic[n] = 1
1010
return False
11+
12+
# 2nd attempt
13+
class Solution:
14+
def containsDuplicate(self, nums: List[int]) -> bool:
15+
return len(set(nums)) != len(nums)

0 commit comments

Comments
 (0)