Submission Detail

23 / 23 test cases passed.
Status:

Accepted

Runtime: 114 ms
Memory Usage: 15.5 MB
Submitted: 0 minutes ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

70
75
80
85
90
95
100
105
110
115
120
125
130
135
1
2
3
4
5
6
7
python
You are here!
Your runtime beats 8.78 % of python submissions.
Runtime (ms)
Distribution (%)

Zoom area by dragging across this chart

Accepted Solutions Memory Distribution

13700
13800
13900
14000
14100
14200
14300
14400
14500
14600
14700
14800
5
10
15
20
25
30
35
python
Memory (KB)
Distribution (%)

13700
13800
13900
14000
14100
14200
14300
14400
14500
14600
14700
14800
10
20
30
Zoom area by dragging across this chart

Invite friends to challenge Two Sum II - Input Array Is Sorted


Submitted Code: 0 minutes ago

Language: python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Solution(object):
def twoSum(self, numbers, target):
"""
:type numbers: List[int]
:type target: int
:rtype: List[int]
"""
indices = []
seen = []
for i in range(0,len(numbers)-1):
if (numbers[i] not in seen):
seen.append(numbers[i])
else:
continue
for j in range(i+1,len(numbers)):
if (numbers[i] + numbers[j] == target):
indices.append(i+1)
indices.append(j+1)
return indices
indices = []
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX