一:题目
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/068d3e76c1b57027f8e806587a6438fe.png)
二:上码
class Solution {
List<List<Integer>> ans = new ArrayList<>();
List<Integer> path = new ArrayList<>();
public boolean getIcrease(List<Integer> nums) {
for (int i = 0;i < nums.size(); i++) {
if (i-1 >= 0 && nums.get(i) < nums.get(i-1)) return false;
}
return true;
}
public void getAns(int[] nums,int st) {
if (path.size() >= 2 && getIcrease(path)) {
ans.add(new ArrayList<>(path));
}
Map<Integer,Integer> map = new HashMap<>();
for (int i = st; i < nums.length; i++) {
map.put(nums[i],map.getOrDefault(nums[i],0)+1);
if (map.getOrDefault(nums[i],0) > 1) continue;
path.add(nums[i]);
getAns(nums,i+1);
path.remove(path.size()-1);
}
}
public List<List<Integer>> findSubsequences(int[] nums) {
getAns(nums,0);
return ans;
}
}