标签:pre solution sub span seq incr div mat for
1 class Solution { 2 public int findLengthOfLCIS(int[] nums) { 3 if(nums.length == 0) return 0; 4 if(nums.length == 1) return 1; 5 int[] dp = new int[nums.length]; 6 dp[0] = 1; 7 for(int i = 1; i < nums.length; i++){ 8 dp[i] = 1; 9 if(nums[i] > nums[i-1]){ 10 dp[i] = dp[i-1] + 1; 11 } 12 } 13 int max = 0; 14 for(int i = 0; i < dp.length; i++){ 15 max = Math.max(max, dp[i]); 16 } 17 return max; 18 } 19 }
674. Longest Continuous Increasing Subsequence
标签:pre solution sub span seq incr div mat for
原文地址:https://www.cnblogs.com/goPanama/p/9864042.html