mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-03 19:03:42 +08:00
Update the codes of backtracking.
This commit is contained in:
@@ -26,6 +26,7 @@ public class permutations_ii {
|
||||
duplicated.add(choice); // 记录选择过的元素值
|
||||
selected[i] = true;
|
||||
state.add(choice);
|
||||
// 进行下一轮选择
|
||||
backtrack(state, choices, selected, res);
|
||||
// 回退:撤销选择,恢复到之前的状态
|
||||
selected[i] = false;
|
||||
|
||||
Reference in New Issue
Block a user