diff --git a/problems/0055.跳跃游戏.md b/problems/0055.跳跃游戏.md index a25c831a..ae2cbd1e 100644 --- a/problems/0055.跳跃游戏.md +++ b/problems/0055.跳跃游戏.md @@ -122,6 +122,24 @@ class Solution: ``` Go: +```Go +func canJUmp(nums []int) bool { + if len(nums)<=1{ + return true + } + dp:=make([]bool,len(nums)) + dp[0]=true + for i:=1;i=0;j--{ + if dp[j]&&nums[j]+j>=i{ + dp[i]=true + break + } + } + } + return dp[len(nums)-1] +} +```