LeetCode 674 Longest Continuous Increasing Subsequence

LeetCode 674 Longest Continuous Increasing Subsequence Problem

Download Code
class Solution(object):
    def findLengthOfLCIS(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        if not nums or len(nums) == 0:
            return 0
        ans = curr = 1
        for i in range(len(nums) - 1):
            if nums[i] < nums[i + 1]:
                curr += 1
                ans = max(ans, curr)
            else:
                curr = 1
        return ans
Download Longest Continuous Increasing Subsequence.py

List of all Longest Continuous Increasing Subsequence problems

Leetcode 674 Longest Continuous Increasing Subsequence problem solution in python3 with explanation. This is the best place to expand your knowledge and get prepared for your next interview.

Feedback is the most important part of any website.

If you have any query, suggestion or feedback, Please feel free to contact us.