给定无重复正整数数组 candidates 和非负目标 target,返回所有和等于 target 的组合。候选数可以重复使用,组合中顺序不同不视为不同答案。
输入:
1candidates = [2,3,6,7] 2target = 7
输出:
1[[2,2,3],[7]]
2 可以重复使用,[2,2,3] 与 [3,2,2] 是同一个组合,只返回一次;组间顺序不限。
输入:
1candidates = [2] 2target = 1
输出:
1[]
没有合法组合,返回空列表;不能拆开候选数字 2。
参考答案:
最近更新时间:2026-11-24

题库维护不易,您的支持就是我们最大的动力!