1
2
3
4
5
6
|
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
ans=False
numsSet=list(set(nums))
if sorted(nums) != sorted(numsSet) : ans=True
return ans
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
Leetcode 268. Missing Number (0) | 2022.03.28 |
---|---|
leetcode 2129. Capitalize the Title (0) | 2022.03.25 |
leetcode 389. Find the Difference (0) | 2022.03.24 |
leetcode 1394. Find Lucky Integer in an Array (0) | 2022.03.24 |
leetcode 1491. Average Salary Excluding the Minimum and Maximum Salary (0) | 2022.03.24 |
댓글