Combination Sum

因为可以重复取,每一次都可以从上一层选的数开始数.但重复的数必须跳过

Combination Sum II

因为不可以重复取,每一次从上一层的下一个数开始数.同样重复的数必须跳过,但是不同层可以取相同的数

backtracking 用 linkedlist( the time complexity of Remove the last element is O(1))

results matching ""

    No results matching ""