Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit759f053

Browse files
committed
整数拆分.md Javascript
1 parente339f19 commit759f053

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

‎.vscode/launch.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎problems/0343.整数拆分.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,20 @@ class Solution:
225225
Go:
226226

227227

228-
228+
#"diff-0c7877fa88aa275252ec257c2077704d0c9de9dfca2358cf935ebfb107de75c6-228-229-0" data-selected="false" role="gridcell" tabindex="-1" valign="top">
229+
```Javascript
230+
varintegerBreak=function(n) {
231+
let dp=newArray(n+1).fill(0)
232+
dp[2]=1
233+
234+
for(let i=3; i<= n; i++) {
235+
for(let j=1; j< i; j++) {
236+
dp[i]=Math.max(dp[i], dp[i- j]* j, (i- j)* j)
237+
}
238+
}
239+
return dp[n]
240+
};
241+
```
229242

230243
-----------------------
231244
* 作者微信:[程序员Carl](https://mp.weixin.qq.com/s/b66DFkOp8OOxdZC_xLZxfw)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp