Submission Detail

72 / 72 test cases passed.
Status:

Accepted

Runtime: 636 ms
Memory Usage: 36.5 MB
Submitted: 1 week, 1 day ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

400
420
440
460
480
500
520
540
560
580
0.5
1.0
1.5
2.0
2.5
3.0
python
Runtime (ms)
Distribution (%)

400
420
440
460
480
500
520
540
560
580
1
2
3
Zoom area by dragging across this chart

Accepted Solutions Memory Distribution

22000
23000
24000
25000
26000
27000
28000
29000
5
10
15
python
Memory (KB)
Distribution (%)

22000
23000
24000
25000
26000
27000
28000
29000
5
10
15
Zoom area by dragging across this chart

Invite friends to challenge Contains Duplicate


Submitted Code: 1 week, 1 day ago

Language: python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Solution(object):
def containsDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
numbers = {}
for i in range(0,len(nums)):
if (nums[i] not in numbers):
numbers[nums[i]] = [i]
else:
numbers[nums[i]].append(i)
for n in numbers:
if (len(numbers[n]) > 1):
return True
return False
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX