摘要:
利用哈希表 class Solution: def permute(self, nums: List[int]) -> List[List[int]]: ans = [] path = [] n = len(nums) def dfs(i, s): if i==n: ans.append(path[ 阅读全文
摘要:
例题: 方法一:枚举下一个数选哪个 class Solution: def combine(self, n: int, k: int) -> List[List[int]]: ans = [] path = [] def dfs(i: int) -> None: d = k - len(path) 阅读全文