From a45758ef5f629807e248ea87407611bcbf42ed88 Mon Sep 17 00:00:00 2001 From: iYaovo <2293257241@qq.com> Date: Fri, 11 Oct 2024 10:13:18 +0800 Subject: [PATCH] =?UTF-8?q?docs:=E8=A1=A5=E5=85=850046Java=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=9A=84return=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0046.全排列.md | 2 ++ 1 file changed, 2 insertions(+) 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 +