mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-13 23:55:39 +08:00
build
This commit is contained in:
@@ -659,10 +659,7 @@ $$
|
||||
return 1;
|
||||
}
|
||||
// 初始化 dp 表,用于存储子问题的解
|
||||
const dp = Array.from(
|
||||
{ length: n + 1 },
|
||||
() => new Array(3)
|
||||
);
|
||||
const dp = Array.from({ length: n + 1 }, () => new Array(3));
|
||||
// 初始状态:预设最小子问题的解
|
||||
dp[1][1] = 1;
|
||||
dp[1][2] = 0;
|
||||
|
||||
Reference in New Issue
Block a user