Skip to content

Commit f54580f

Browse files
committed
feat: 217. Contains Duplicate
1 parent 67949d5 commit f54580f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

contains-duplicate/HodaeSsi.py

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

0 commit comments

Comments
 (0)