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 + } +} +``` -----------------------