Skip to content

Commit 29a569b

Browse files
committed
ADD : contains-duplicate/heypaprika.py
1 parent 8901b1d commit 29a569b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

contains-duplicate/heypaprika.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def containsDuplicate(self, nums: List[int]) -> bool:
3+
num_dict = {}
4+
for num in nums:
5+
if num in num_dict:
6+
return True
7+
else:
8+
num_dict[num] = 1
9+
return False
10+

0 commit comments

Comments
 (0)