From e15beb5f14f212e2ffe24bedba1e5ae30fdcaba7 Mon Sep 17 00:00:00 2001 From: jiecheney <89916583+JakeVander@users.noreply.github.com> Date: Thu, 14 Jul 2022 10:41:34 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=200090.=E5=AD=90?= =?UTF-8?q?=E9=9B=86II.md=20Python3=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 8 +++ .idea/encodings.xml | 6 ++ .idea/inspectionProfiles/Project_Default.xml | 70 +++++++++++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++ .idea/leetcode-master.iml | 8 +++ .idea/misc.xml | 11 +++ .idea/modules.xml | 8 +++ .idea/vagrant.xml | 7 ++ .idea/vcs.xml | 6 ++ problems/0090.子集II.md | 27 +++++++ 10 files changed, 157 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/encodings.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/leetcode-master.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vagrant.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..35410cac --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..c2bae49d --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..3f19e2d8 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,70 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/leetcode-master.iml b/.idea/leetcode-master.iml new file mode 100644 index 00000000..d0876a78 --- /dev/null +++ b/.idea/leetcode-master.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..8ca8e3b1 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..7c250acd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vagrant.xml b/.idea/vagrant.xml new file mode 100644 index 00000000..a5aa7868 --- /dev/null +++ b/.idea/vagrant.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/problems/0090.子集II.md b/problems/0090.子集II.md index e85ec66d..d503846e 100644 --- a/problems/0090.子集II.md +++ b/problems/0090.子集II.md @@ -261,6 +261,33 @@ class Solution: self.path.pop() ``` +### Python3 +```python3 +class Solution: + def subsetsWithDup(self, nums: List[int]) -> List[List[int]]: + res = [] + path = [] + nums.sort() # 去重需要先对数组进行排序 + + def backtracking(nums, startIndex): + # 终止条件 + res.append(path[:]) + if startIndex == len(nums): + return + + # for循环 + for i in range(startIndex, len(nums)): + # 数层去重 + if i > startIndex and nums[i] == nums[i-1]: # 去重 + continue + path.append(nums[i]) + backtracking(nums, i+1) + path.pop() + + backtracking(nums, 0) + return res +``` + ### Go ```Go From cb01b142fb04123a4debfbe8a2e1950fb13b3479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:34:28 +0800 Subject: [PATCH 02/10] Delete .gitignore --- .idea/.gitignore | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 35410cac..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# 默认忽略的文件 -/shelf/ -/workspace.xml -# 基于编辑器的 HTTP 客户端请求 -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml From 5d690afae6e501fcdf0385f23bb81ddc633c4bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:34:34 +0800 Subject: [PATCH 03/10] Delete encodings.xml --- .idea/encodings.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/encodings.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index c2bae49d..00000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 52c395702c37d28f459c0076279ef0e34bad6f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:34:41 +0800 Subject: [PATCH 04/10] Delete profiles_settings.xml --- .idea/inspectionProfiles/profiles_settings.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2da..00000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file From 0f042a29cc62efe0cbdb4c69f717e1800f72e561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:34:47 +0800 Subject: [PATCH 05/10] Delete modules.xml --- .idea/modules.xml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 7c250acd..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 8b10e7473188a6dd5922566239049364cfa8a1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:35:00 +0800 Subject: [PATCH 06/10] Delete vagrant.xml --- .idea/vagrant.xml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .idea/vagrant.xml diff --git a/.idea/vagrant.xml b/.idea/vagrant.xml deleted file mode 100644 index a5aa7868..00000000 --- a/.idea/vagrant.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file From ea9f7c61392b8902aa3844ffcfdf4b360c5f609a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:35:07 +0800 Subject: [PATCH 07/10] Delete vcs.xml --- .idea/vcs.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 227f8ee98d4b3ad5a713488bdd4435d2e784c154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:35:20 +0800 Subject: [PATCH 08/10] Delete Project_Default.xml --- .idea/inspectionProfiles/Project_Default.xml | 70 -------------------- 1 file changed, 70 deletions(-) delete mode 100644 .idea/inspectionProfiles/Project_Default.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 3f19e2d8..00000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - \ No newline at end of file From d49ca8f278f57831b9410d9a419845b199dcb395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:35:28 +0800 Subject: [PATCH 09/10] Delete leetcode-master.iml --- .idea/leetcode-master.iml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/leetcode-master.iml diff --git a/.idea/leetcode-master.iml b/.idea/leetcode-master.iml deleted file mode 100644 index d0876a78..00000000 --- a/.idea/leetcode-master.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 2a4a210b45d9ea8b67dc19e18591cb622941d7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98Carl?= Date: Tue, 2 Aug 2022 09:35:35 +0800 Subject: [PATCH 10/10] Delete misc.xml --- .idea/misc.xml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .idea/misc.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 8ca8e3b1..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - \ No newline at end of file