diff --git a/problems/0053.最大子序和.md b/problems/0053.最大子序和.md index 436e763b..6474d01f 100644 --- a/problems/0053.最大子序和.md +++ b/problems/0053.最大子序和.md @@ -175,8 +175,29 @@ class Solution: ``` 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 + } +} +``` -----------------------