题解 | #数组中重复的数字#

数组中重复的数字

http://www.nowcoder.com/practice/6fe361ede7e54db1b84adc81d09d8524

class Solution: def duplicate(self , numbers: List[int]) -> int: # write code here s=set() if len(numbers)==0: return -1 for i in numbers: if i not in s: s.add(i) else: return i

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务