标签:找工作 dup duplicate 状态 object lse pre span etc
# 解题思路:字典存储计数状态 20190302 找工作期间
class Solution(object):
def containsDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
record = {}
for i in range(len(nums)):
record[nums[i]]=record.get(nums[i],0)+1
if record[nums[i]] >= 2:
return True
return False
标签:找工作 dup duplicate 状态 object lse pre span etc
原文地址:https://www.cnblogs.com/lux-ace/p/10546919.html