From 039174e723c33526fd07a82a3abcfe9cc1089727 Mon Sep 17 00:00:00 2001 From: gdnlnsjd <84071244+gdnlnsjd@users.noreply.github.com> Date: Sat, 15 May 2021 10:30:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Update=200046.=E5=85=A8=E6=8E=92=E5=88=97.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0046.全排列.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/problems/0046.全排列.md b/problems/0046.全排列.md index 5f7b1ac0..0b3174f0 100644 --- a/problems/0046.全排列.md +++ b/problems/0046.全排列.md @@ -147,6 +147,30 @@ public: Java: +class Solution { + List> result=new ArrayList>(); + Deque path=new LinkedList(); + void backtracking(int []nums,Boolean []used) { + if(path.size()==nums.length) { + result.add(new ArrayList(path)); + return; + } + for(int i=0;i> permute(int[] nums) { + Boolean []used=new Boolean[nums.length]; + for(int i=0;i Date: Sat, 15 May 2021 10:44:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Update=200046.=E5=85=A8=E6=8E=92=E5=88=97.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0046.全排列.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/problems/0046.全排列.md b/problems/0046.全排列.md index 0b3174f0..373c9257 100644 --- a/problems/0046.全排列.md +++ b/problems/0046.全排列.md @@ -147,6 +147,7 @@ public: Java: +```java class Solution { List> result=new ArrayList>(); Deque path=new LinkedList(); @@ -171,7 +172,7 @@ class Solution { return result; } } - +``` Python: