刚刚在leetcode上写了一道算法题:39. Combination Sum,因为踩了python中复制的坑,花了很长时间才爬出来=。=
题目:
Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited number of times.
起因是用python做完题后看了一下c++的解法:
class Solution {
public:
std::vector<std::vector<int> > combinationSum(std::vector<int> &candidates,