Skip to content

Commit 1c2b478

Browse files
committed
Add solutions
1 parent 990065d commit 1c2b478

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

contains-duplicate/hypoxisaurea.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from typing import List
2+
3+
class Solution:
4+
def containsDuplicate(self, nums: List[int]) -> bool:
5+
num_set = set()
6+
7+
for num in nums:
8+
if num in num_set:
9+
return True
10+
else:
11+
num_set.add(num)
12+
13+
return False

0 commit comments

Comments
 (0)