腾讯15-存在重复元素leetcode217 比较简单,判断去set() 前后操作是否一致即可,注意列表长度为空和列表长度为1的情况 class Solution: def containsDuplicate(self, nums: List[int]) -> bool: if len(nums)<=1: return False else: if len(nums)==len(set(nums)): return False else: return True