题目描述:
题解:
遍历数组nums,如果当前值等于target,次数加一。
class Solution(object): def findRepeatNumber(self, nums): numsdict = {} for num in nums: if num in list(numsdict): return num else: numsdict[num] = 1
题目描述:
题解:
遍历数组nums,如果当前值等于target,次数加一。
class Solution(object): def findRepeatNumber(self, nums): numsdict = {} for num in nums: if num in list(numsdict): return num else: numsdict[num] = 1