# LeetCode Longest Increasing Subsequence DP

java code :

public class Solution {
public int lengthOfLIS(int[] nums) {
if(nums == null || nums.length == 0) return 0;
int[] dp = new int[nums.length];
Arrays.fill(dp, 1);
int ans = 1;
for(int i = 0; i < nums.length; ++i) {
for(int j = 0; j < i; ++j) {
if(nums[j] < nums[i]) {
dp[i] = Integer.max(dp[i], dp[j] + 1);
}
}
ans = dp[i] > ans ? dp[i] : ans;
}
return ans;
}
}

#### LeetCode 300. Longest Increasing Subsequence 解题报告

2016-02-16 19:35:07

#### leetcode题解-300. Longest Increasing Subsequence

2017-09-20 09:41:06

#### Leetcode 673 Number of Longest Increasing Subsequence(第六周作业)

2017-10-29 11:59:37

#### leetcode -- Longest Increasing Subsequence -- DP 重点常考

2015-12-14 18:01:00

#### 【LEETCODE】300-Longest Increasing Subsequence [Python]

2016-01-07 20:36:24

#### leetcode 300. Longest Increasing Subsequence-最长子序列|动态规划

2016-06-02 20:17:05

#### leetcode 300: Longest Increasing Subsequence

2015-11-03 11:24:29

#### DP问题：leetcode(300) Longest Increasing Subsequence

2018-01-25 10:37:18

#### LWC 49：674. Longest Continuous Increasing Subsequence

2017-09-10 14:03:50