摘要: 组合总和 题目链接:39. 组合总和 - 力扣(LeetCode) 思路:依然一是套用回溯模板,但是我们这里用回溯的是i而不是i+1,因为元素可以重复使用,注意for循环里if(sum(path)<=target)的等号不能少。 class Solution { public: vector<int 阅读全文
posted @ 2024-02-23 19:20 SandaiYoung 阅读(19) 评论(0) 推荐(0)