Skip to content

Commit

Permalink
Update 0343.整数拆分.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghongcheng authored Jun 12, 2023
1 parent 5527410 commit 072eb2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion problems/0343.整数拆分.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,11 @@ class Solution:

# 计算切割点j和剩余部分(i-j)的乘积,并与之前的结果进行比较取较大值

dp[i] = max(dp[i], max((i - j) * j, dp[i - j] * j))
dp[i] = max(dp[i], (i - j) * j, dp[i - j] * j)

return dp[n] # 返回最终的计算结果


```
动态规划(版本二)
```python
Expand Down

0 comments on commit 072eb2a

Please sign in to comment.