287. Find the Duplicate Number
来源:互联网 发布:淘宝宝贝一键上传 编辑:程序博客网 时间:2024/06/10 01:39
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
阅读全文
0 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
- 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
- 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
- this踩坑
- shiro什么时候进入doGetAuthorizationInfo(PrincipalCollection principals)
- 运动鞋
- java修饰符
- JS中的JSON对象
- 287. Find the Duplicate Number
- Problem C: STL——Jerry的问题
- 【算法题】优雅的点
- Properties类
- 刷题(一)
- epoll和select区别
- __cplusplus,extern "C"的作用
- 基于邻接链表和邻接矩阵实现图的各种常用函数C++
- BZOJ 1626 & luogu 2872 [USACO07DEC]道路建设Building Roads Kruskal