Submission Detail

172 / 172 test cases passed.
Status:

Accepted

Runtime: 445 ms
Memory Usage: 14.7 MB
Submitted: 3 days ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

500
1000
1500
2000
2500
3000
3500
4000
4500
5000
5500
0.5
1.0
1.5
2.0
2.5
python
You are here!
Your runtime beats 21.77 % of python submissions.
Runtime (ms)
Distribution (%)

500
1000
1500
2000
2500
3000
3500
4000
4500
5000
5500
1.0
2.0
Zoom area by dragging across this chart

Accepted Solutions Memory Distribution

14100
14150
14200
14250
14300
14350
14400
14450
14500
14550
14600
14650
14700
14750
14800
5
10
15
20
25
30
python
You are here!
Your memory usage beats 14.77 % of python submissions.
Memory (KB)
Distribution (%)

14100
14150
14200
14250
14300
14350
14400
14450
14500
14550
14600
14650
14700
14750
14800
10
20
30
Zoom area by dragging across this chart

Invite friends to challenge Jump Game


Submitted Code: 3 days ago

Language: python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class Solution(object):
def canJump(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
if (len(nums)==1):
return True
if (len(nums) > 1 and nums[0] == 0):
return False
numbers_seen = []
for i in range(0,len(nums)):
if (nums[i] >= len(nums) - 1 - i):
return True
numbers_seen.append(nums[i])
if (nums[i] >= len(nums)- 1- i):
continue
if (nums[i]==0):
bypass = False
# print("zero at index ",i)
# print(numbers_seen)
for j in range(0,len(numbers_seen)):
# print(i," - ",j," < ",numbers_seen[j],"?")
if (i-j < numbers_seen[j]):
bypass = True
# print("bypass = ",bypass)
if (bypass == False):
return False
return True
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX