287. Find the Duplicate Number
2017-06-01 19:32
337 查看
class Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
dic={}
for i in nums:
if i in dic:
return i
else:
dic[i]=0
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
dic={}
for i in nums:
if i in dic:
return i
else:
dic[i]=0
相关文章推荐
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number [Leetcode]
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number。
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287.leetcode Find the Duplicate Number(hard)[数组 重复元素]
- 287. Find the Duplicate Number(unsolved)
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287. 发现重复的数量(Find the Duplicate Number)
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number
- 287. Find the Duplicate Number***