Increasing Subsequences
Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2 .
Example:
Note:
The length of the given array will not exceed 15.
The range of integer in the given array is [-100,100].
The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence.
分析
这里好像可以用subset方法?
dfs带start参数
去重在本层for 保持一个set,使用过的数字不再用。比较combination sum去重,直接sort,和前面比较相等就跳过,
这里不能sort,因为要顺序比较大小。只能用set来去重。
Last updated
Was this helpful?