# coding:utf-8
'''
@Copyright:LintCode
@Author:   ultimate010
@Problem:  http://www.lintcode.com/problem/jump-game
@Language: Python
@Datetime: 16-06-10 07:26
'''

class Solution:
    # @param A, a list of integers
    # @return a boolean
    def canJump(self, A):
        # write your code here
        maxPos = 0
        i = 0
        while i < len(A) and i <= maxPos:
            maxPos = max(maxPos, A[i] + i)
            if maxPos >= len(A) - 1:
                return True
            i += 1
        return False
60964ac52cfc9c85118a67e1140a131f593a0776
<mask token>

<mask token>


class Solution:
    <mask token>

<mask token>


class Solution:

    def canJump(self, A):
        maxPos = 0
        i = 0
        while i < len(A) and i <= maxPos:
            maxPos = max(maxPos, A[i] + i)
            if maxPos >= len(A) - 1:
                return True
            i += 1
        return False

# coding:utf-8
'''
@Copyright:LintCode
@Author:   ultimate010
@Problem:  http://www.lintcode.com/problem/jump-game
@Language: Python
@Datetime: 16-06-10 07:26
'''

class Solution:
    # @param A, a list of integers
    # @return a boolean
    def canJump(self, A):
        # write your code here
        maxPos = 0
        i = 0
        while i < len(A) and i <= maxPos:
            maxPos = max(maxPos, A[i] + i)
            if maxPos >= len(A) - 1:
                return True
            i += 1
        return False