@wxl163530 I use backtracking, but it reached time limited. Here is my code:

int max = 0;

public int findNumberOfLIS(int[] nums) {

List<List<Integer>> res = new ArrayList<>();

if (nums == null || nums.length < 1) {

return res.size();

}

dfs(res, new ArrayList<>(), nums, 0);

return res.size();

}

public void dfs(List<List<Integer>> res , List<Integer> p, int[] nums, int index) {
if (index == nums.length) {
if (p.size() > max) {
max = p.size();
res.clear();
res.add(new ArrayList<>(p));
return;
} else if (p.size() == max) {
res.add(new ArrayList<>(p));
return;
}
return;
}
for (int i = index; i < nums.length; i++) {
if (p.size() == 0) {
p.add(nums[i]);
dfs(res, p, nums, i+ 1);
p.remove(p.size() - 1);
} else if (nums[i] > p.get(p.size() - 1)){
p.add(nums[i]);
dfs(res, p, nums, i + 1);
p.remove(p.size() - 1);
} else {
dfs(res, p, nums, i + 1);
break;
}
}
}