Skip to content

Commit 5034b9d

Browse files
Merge pull request #18 from Pal-Sandeep/17-217-contains-duplicate
Create 217-Contains-Duplicate.py
2 parents 3997fa6 + 8fec7f1 commit 5034b9d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

217-Contains-Duplicate.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution:
2+
def containsDuplicate(self, nums: List[int]) -> bool:
3+
length=len(nums)
4+
nums[:]=sorted(nums)
5+
return any(nums[i]==nums[i+1] for i in range(length-1))

0 commit comments

Comments
 (0)