Skip to content

Commit 1d47595

Browse files
committed
contains-duplicate solution
1 parent 6b69bb9 commit 1d47595

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contains-duplicate/Donghae0230.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def containsDuplicate(self, nums: List[int]) -> bool:
3+
set_nums = set(nums)
4+
list_nums = list(set_nums)
5+
if len(nums) != len(list_nums):
6+
return True
7+
else:
8+
return False

0 commit comments

Comments
 (0)