@@ -0,0 +1,1336 @@
+package array;%0A%0Apublic class LongestContinuousIncreasingSubsequence %7B%0A%0A    //TAG: Facebook%0A    //TAG: array%0A%0A    /**%0A     * 674. Longest Continuous Increasing Subsequence%0A     * Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).%0A     *%0A     * Example 1:%0A     * Input: %5B1,3,5,4,7%5D%0A     * Output: 3%0A     * Explanation: The longest continuous increasing subsequence is %5B1,3,5%5D, its length is 3.%0A     * Even though %5B1,3,5,7%5D is also an increasing subsequence, it's not a continuous one where 5 and 7 are separated by 4.%0A     * Example 2:%0A     * Input: %5B2,2,2,2,2%5D%0A     * Output: 1%0A     * Explanation: The longest continuous increasing subsequence is %5B2%5D, its length is 1.%0A     * Note: Length of the array will not exceed 10,000.%0A     */%0A%0A    /**%0A     * Solution:%0A     * First ask continuous increasing subsequence is 0,1,2,3 or increasing subarray%0A     *%0A     * Time: O(n)%0A     * Space: O(1)%0A     */%0A%0A    public int findLengthOfLCIS(int%5B%5D nums) %7B%0A        if (nums == null %7C%7C nums.length == 0) return 0;%0A        int cur = 1, max = 1;%0A        for (int i = 1; i %3C nums.length; i++) %7B%0A            if (nums%5Bi%5D %3E nums%5Bi - 1%5D) cur++;%0A            else %7B%0A                max = Math.max(max, cur);%0A                cur = 1;%0A            %7D%0A        %7D%0A        return Math.max(max, cur);%0A    %7D%0A%0A%7D%0A

674. Longest Continuous Increasing Subsequence