674. Longest Continuous Increasing Subsequence

简单的扫描数组就好了

class Solution {
    public int findLengthOfLCIS(int[] nums) {
        if(nums==null||nums.length==0) return 0;
        int len  = 1 ;
        int max = 1;
        for(int i = 1 ;inums[i-1])
            {
                len++;
                if(len>max)
                    max=len;
            }
            else
            {
                len=1;
            }
        
        }
        return max;
    }
}

你可能感兴趣的:(674. Longest Continuous Increasing Subsequence)