跳到主要内容

资源 · 指南或文章

Combination Sum Problem

组合总和问题的题目陈述和回溯思路:候选数可以重复使用,且总和必须等于目标值。

审核日期

打开原站: Combination Sum Problem (在新标签页中打开原网站)

添加到路线图

把这个资源放进你正在跟进的路线图。它会作为你自己的补充资源显示;路线图的步骤不会改变,也不计入你已记录的步骤。

来源内容语言:英语

Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. The same repeated number may be chosen from candidates unlimited number of times. Since the problem is to get all the possible results, not the best or the number of result, thus we don’t need to consider DP (dynamic programming), backtracking approach using recursion is needed to handle it.

PrepKit 概览

本概览由 PrepKit 编辑根据源代码仓库撰写并审核,并非资源本身的文字。

适合人群
来源未说明适用级别
形式
问题列表

涵盖内容

  • 题目规则:候选数互不相同且为正数,可无限次重复使用,不能有重复的组合。
  • 两组输入示例及其完整解集。
  • 为什么 README 选择带回溯的递归而不是动态规划,并附候选数 [2, 3]、目标值 6 的决策树。

使用建议

这是 PrepKit 的学习建议,并非来源的说法。

在阅读任何代码之前,先根据决策树求解,然后解释你如何避免顺序不同的重复组合。

范围与局限

内容简短,题目本身来自 LeetCode,这也是唯一的参考资料。没有复杂度分析。

获取方式与形式

GitHub 上的免费英文 README(trekhleb/javascript-algorithms,MIT 许可)。

PrepKit 于 2026年10月2日 审核。 资源来源提交: 85293e3e2b88

本概览的依据
  • src/algorithms/sets/combination-sum/README.md

收录此条目的页面

订阅 PrepKit 通讯

可选。使用 PrepKit 并不需要订阅。

我们如何处理你的邮箱