From 0cb990ac45463b350e0d825bf23263c4ce5e904b Mon Sep 17 00:00:00 2001 From: QuinnDK <39618652+QuinnDK@users.noreply.github.com> Date: Fri, 14 May 2021 09:38:34 +0800 Subject: [PATCH] =?UTF-8?q?Update=200046.=E5=85=A8=E6=8E=92=E5=88=97.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0046.全排列.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/problems/0046.全排列.md b/problems/0046.全排列.md index 5f7b1ac0..0d7e7e92 100644 --- a/problems/0046.全排列.md +++ b/problems/0046.全排列.md @@ -153,7 +153,36 @@ Python: Go: +```Go +var result [][]int +func backtrack(nums,pathNums []int,used []bool){ + if len(nums)==len(pathNums){ + tmp:=make([]int,len(nums)) + copy(tmp,pathNums) + result=append(result,tmp) + //result=append(result,pathNums) + return + } + for i:=0;i