• Skip to primary navigation
  • Skip to content
  • Skip to footer
zhicheng xie's demo blog
  • Quick-Start Guide

    Your Name

    I am an amazing person.

    • Somewhere

    Longest Continuous Increasing Subsequence

    less than 1 minute read

    <-E 674> Longest Continuous Increasing Subsequence

    class Solution {
    public:
        int findLengthOfLCIS(vector<int>& nums) {
            int n = nums.size(), result = 1, current = 1;
            if(n == 0) 
                return 0;
            for(int i = 1; i < n; i++){
                if(nums[i] > nums[i-1]) 
                    current++;
                else 
                    current = 1;
                result = max(result, current);
            }
            return result; 
        }
    };
    

    Tags: Algorithms, C++, Leetcode

    Updated: December 30, 2020

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    You may also enjoy

    Decode Ways

    less than 1 minute read

    <-M 91> Decode Ways

    Word Break

    less than 1 minute read

    <-H 139> Word Break

    Distinct Subsequences

    less than 1 minute read

    <-H 115> Distinct Subsequences

    Edit Distance

    less than 1 minute read

    <-H 72> Edit Distance

    • Follow:
    • Feed
    © 2023 zhicheng xie's blog. Powered by Jekyll & Minimal Mistakes.