diff --git a/problems/0046.全排列.md b/problems/0046.全排列.md index 1ef80a14..ab7af3ba 100644 --- a/problems/0046.全排列.md +++ b/problems/0046.全排列.md @@ -201,6 +201,7 @@ class Solution { public void backtrack(int[] nums, LinkedList path) { if (path.size() == nums.length) { result.add(new ArrayList<>(path)); + return; } for (int i =0; i < nums.length; i++) { // 如果path中已有,则跳过 @@ -524,3 +525,4 @@ public class Solution +