300. 最长递增子序列
https://leetcode-cn.com/problems/longest-increasing-subsequence/
//dp[i]的值代表以nums[i]结尾的最长子序列长度
//dp[i] 所有元素置 1
//含义是每个元素都至少可以单独成为子序列,此时长度都为 1
class Solution {
public int lengthOfLIS(int[] nums) {
if(nums.length == 0){
return 0;
}
int[] dp = new int[nums.length];
int res = 0