Skip to content

Commit 12e62d0

Browse files
committed
contain duplicate solution
1 parent f551b03 commit 12e62d0

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

contains-duplicate/hyeri0903.py

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

0 commit comments

Comments
 (0)