From b264368a899da285eccf27bb7cfcb7ebec4b088e Mon Sep 17 00:00:00 2001 From: QuinnDK <39618652+QuinnDK@users.noreply.github.com> Date: Wed, 19 May 2021 10:25:58 +0800 Subject: [PATCH] =?UTF-8?q?Update=200055.=E8=B7=B3=E8=B7=83=E6=B8=B8?= =?UTF-8?q?=E6=88=8F.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0055.跳跃游戏.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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] +} +```