# 55. 跳跃游戏

<https://leetcode-cn.com/problems/jump-game/>

## 解法一：贪心

类似**45. 跳跃游戏 II** 的思路，不用求步数，只需看end能不能到达末尾即可

```python
class Solution:
    def canJump(self, nums: List[int]) -> bool:
        end = 0    #当前能到达的距离
        farthest = 0    #向前探测[i,end]所能到达的最远距离
        for i in range(len(nums)-1):
            farthest = max(i+nums[i], farthest)    #更新最远距离
            if i == end:    #走了一步
                end = farthest    #更新能到达的距离
        return end >= len(nums)-1
```
