Skip to content

Commit 95ae9db

Browse files
committed
adding contains duplicated
1 parent f39db86 commit 95ae9db

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contains-duplicate/daiyongg-kim.py

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

0 commit comments

Comments
 (0)