From 50f42c90ebb8ff078256414b731b533a54d0abbb Mon Sep 17 00:00:00 2001 From: QuinnDK <39618652+QuinnDK@users.noreply.github.com> Date: Thu, 13 May 2021 09:39:02 +0800 Subject: [PATCH] =?UTF-8?q?Update=200053.=E6=9C=80=E5=A4=A7=E5=AD=90?= =?UTF-8?q?=E5=BA=8F=E5=92=8C.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0053.最大子序和.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/problems/0053.最大子序和.md b/problems/0053.最大子序和.md index b8a9d748..e6d3f1c8 100644 --- a/problems/0053.最大子序和.md +++ b/problems/0053.最大子序和.md @@ -145,8 +145,29 @@ Python: Go: +```Go +func maxSubArray(nums []int) int { + if len(nums)<1{ + return 0 + } + dp:=make([]int,len(nums)) + result:=nums[0] + dp[0]=nums[0] + for i:=1;ib{ + return a + }else{ + return b + } +} +``` -----------------------