class Solution(object):
def findRepeatNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
num_dict = dict()
for x in nums:
if x not in num_dict:
num_dict[x] = 1
else:
return x
剑指Offer:数组中重复的数字
最新推荐文章于 2021-10-02 21:39:01 发布