problem
找出所有組合總和為target 的子序列,每個元素只能取一次,每組組合必須唯一。
sloution
if(i>l && candidates[i-1]==candidates[i]) continue;
skip depulicate
1 | class Solution { |
analysis
- time complexity
O(len(nums)^M)
, M if theight of our recursive - space complexity
L
, L is the longest combination