Merge pull request #1149 from tlylt/fix-typo-416

Fix Qn0416 spelling error
This commit is contained in:
程序员Carl
2022-03-28 09:54:17 +08:00
committed by GitHub

View File

@ -251,14 +251,14 @@ Python
```python
class Solution:
def canPartition(self, nums: List[int]) -> bool:
taraget = sum(nums)
if taraget % 2 == 1: return False
taraget //= 2
target = sum(nums)
if target % 2 == 1: return False
target //= 2
dp = [0] * 10001
for i in range(len(nums)):
for j in range(taraget, nums[i] - 1, -1):
for j in range(target, nums[i] - 1, -1):
dp[j] = max(dp[j], dp[j - nums[i]] + nums[i])
return taraget == dp[taraget]
return target == dp[target]
```
Go
```go