Skip to content

Commit

Permalink
Fix the issues of discusscomment 7949412 and 7985550 (krahets#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
night-cruise authored Jan 6, 2024
1 parent a280c3d commit ad66361
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions codes/rust/chapter_dynamic_programming/coin_change_ii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn coin_change_ii_dp(coins: &[i32], amt: usize) -> i32 {
// 若超过目标金额,则不选硬币 i
dp[i][a] = dp[i - 1][a];
} else {
// 不选和选硬币 i 这两种方案的较小值
// 不选和选硬币 i 这两种方案之和
dp[i][a] = dp[i - 1][a] + dp[i][a - coins[i - 1] as usize];
}
}
Expand All @@ -41,7 +41,7 @@ fn coin_change_ii_dp_comp(coins: &[i32], amt: usize) -> i32 {
// 若超过目标金额,则不选硬币 i
dp[a] = dp[a];
} else {
// 不选和选硬币 i 这两种方案的较小值
// 不选和选硬币 i 这两种方案之和
dp[a] = dp[a] + dp[a - coins[i - 1] as usize];
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/chapter_data_structure/basic_data_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
```rust title=""
// 使用多种基本数据类型来初始化数组
let numbers: Vec<i32> = vec![0; 5];
let decimals: Vec<f32> = vec![0.0, 5];
let decimals: Vec<f32> = vec![0.0; 5];
let characters: Vec<char> = vec!['0'; 5];
let bools: Vec<bool> = vec![false; 5];
```
Expand Down

0 comments on commit ad66361

Please sign in to comment.