避免顺序不同,同时控制长度与和 class Solution: def combinationSum3(self, k: int, n: int) -> List[List[int]]: def dfs(i,path,target,n,k,result): if target==n and len(path)==k: result.append(path[:]) return elif target==n and len(path)!=k: ...