From 7666361cf7a76a211cafd5b57e3cfa511c78d5a6 Mon Sep 17 00:00:00 2001 From: Yudong Jin Date: Mon, 26 Aug 2024 10:11:46 +0800 Subject: [PATCH] Update subset_sum_ii.rs --- codes/rust/chapter_backtracking/subset_sum_ii.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/rust/chapter_backtracking/subset_sum_ii.rs b/codes/rust/chapter_backtracking/subset_sum_ii.rs index 584634df8c..389bae711d 100644 --- a/codes/rust/chapter_backtracking/subset_sum_ii.rs +++ b/codes/rust/chapter_backtracking/subset_sum_ii.rs @@ -32,7 +32,7 @@ fn backtrack( } // 尝试:做出选择,更新 target, start state.push(choices[i]); - // 进行下一轮选择,从i+1开始,避免重复选择 + // 进行下一轮选择 backtrack(state, target - choices[i], choices, i + 1, res); // 回退:撤销选择,恢复到之前的状态 state.pop();