We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbc93eb commit a45758eCopy full SHA for a45758e
problems/0046.全排列.md
@@ -201,6 +201,7 @@ class Solution {
201
public void backtrack(int[] nums, LinkedList<Integer> path) {
202
if (path.size() == nums.length) {
203
result.add(new ArrayList<>(path));
204
+ return;
205
}
206
for (int i =0; i < nums.length; i++) {
207
// 如果path中已有,则跳过
@@ -524,3 +525,4 @@ public class Solution
524
525
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
526
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
527
</a>
528
+
0 commit comments