From 419e67ca91122f505f937e774d41bfd1a8c60246 Mon Sep 17 00:00:00 2001 From: Yuhao Ju Date: Fri, 3 Mar 2023 23:26:04 +0800 Subject: [PATCH] =?UTF-8?q?update=200416.=E5=88=86=E5=89=B2=E7=AD=89?= =?UTF-8?q?=E5=92=8C=E5=AD=90=E9=9B=86=EF=BC=9A=E4=BF=AE=E6=94=B9=20python?= =?UTF-8?q?=20=E4=BB=A3=E7=A0=81=E4=B8=AD=E4=B8=80=E7=BB=B4=E8=83=8C?= =?UTF-8?q?=E5=8C=85=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0416.分割等和子集.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/0416.分割等和子集.md b/problems/0416.分割等和子集.md index 45dd289a..dfb327ec 100644 --- a/problems/0416.分割等和子集.md +++ b/problems/0416.分割等和子集.md @@ -302,7 +302,7 @@ class Solution: target = sum(nums) if target % 2 == 1: return False target //= 2 - dp = [0] * (len(nums) + 1) + dp = [0] * (target + 1) for i in range(len(nums)): for j in range(target, nums[i] - 1, -1): dp[j] = max(dp[j], dp[j - nums[i]] + nums[i])