一、leetcode地址
https://leetcode.com/problems/contains-duplicate/
二、问题描述
三、代码实现
语言:Python3
代码:
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
return len(nums) != len(set(nums))
https://leetcode.com/problems/contains-duplicate/
语言:Python3
代码:
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
return len(nums) != len(set(nums))