提交 061a93d3 编写于 作者: L labuladong

update content

上级 3d91fdd9
...@@ -381,7 +381,7 @@ List<List<Integer>> subsetsWithDup(int[] nums) ...@@ -381,7 +381,7 @@ List<List<Integer>> subsetsWithDup(int[] nums)
![](https://labuladong.github.io/pictures/排列组合/8.jpeg) ![](https://labuladong.github.io/pictures/排列组合/8.jpeg)
``` ```text
[ [
[], [],
[1],[2],[2'], [1],[2],[2'],
...@@ -390,7 +390,7 @@ List<List<Integer>> subsetsWithDup(int[] nums) ...@@ -390,7 +390,7 @@ List<List<Integer>> subsetsWithDup(int[] nums)
] ]
``` ```
所以我们需要进行剪枝,如果一个节点有多条值相同的树枝相邻,则只遍历第一条,剩下的都剪掉,不要去遍历: 你可以看到,`[2]``[1,2]` 这两个结果出现了重复,所以我们需要进行剪枝,如果一个节点有多条值相同的树枝相邻,则只遍历第一条,剩下的都剪掉,不要去遍历:
![](https://labuladong.github.io/pictures/排列组合/9.jpeg) ![](https://labuladong.github.io/pictures/排列组合/9.jpeg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册