We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 408c8f3 commit 1d44a17Copy full SHA for 1d44a17
problems/0416.分割等和子集.md
@@ -302,7 +302,7 @@ class Solution:
302
target = sum(nums)
303
if target % 2 == 1: return False
304
target //= 2
305
- dp = [0] * (len(nums) + 1)
+ dp = [0] * (target + 1)
306
for i in range(len(nums)):
307
for j in range(target, nums[i] - 1, -1):
308
dp[j] = max(dp[j], dp[j - nums[i]] + nums[i])
0 commit comments