摘要:
题目描述: 方法一:回溯 class Solution: def subsetsWithDup(self, nums: List[int]) -> List[List[int]]: nums.sort() if not nums: return [] n = len(nums) res = [] d 阅读全文
摘要:
题目描述: 方法一:回溯 class Solution: def subsets(self, nums: List[int]) -> List[List[int]]: if not sum: return [] res = [] n = len(nums) def backtrack(idx,tem 阅读全文
摘要:
题目描述: 方法一:回溯 class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: #nums = nums.sort() n = len(nums) res = [] def backtrack(num 阅读全文
摘要:
题目描述: 方法一:回溯 class Solution: def permute(self, nums): n = len(nums) res = [] def helper2(nums, temp_list, length): if length == n: res.append(temp_lis 阅读全文
摘要:
题目描述: 方法一:回溯 class Solution: def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]: candidates.sort() res = [] def backtrac 阅读全文