```
class Solution(object):
def canJump(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
p = 0
for i in xrange(len(nums)-1):
if p >= i:
p = max(p, i+nums[i])
if p >= len(nums)-1:
return True
else:
return False
```