Skip to content

Commit 7c7bcc9

Browse files
committed
contains-duplicate solution
1 parent e7a1b5e commit 7c7bcc9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

contains-duplicate/ohkingtaek.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+
"""
4+
nums를 set으로 바꿨을 때 길이가 줄어들면 배열 안에 중복 값이 있다는 의미입니다.
5+
"""
6+
if len(nums) != len(set(nums)):
7+
return True
8+
else:
9+
return False
10+

0 commit comments

Comments
 (0)