Search topics...

Longest Continuous Increasing Subsequence

easy
arrayTime: O(n)Space: O(1)Frequency: 3

Given an unsorted array, find the length of the longest continuous increasing subsequence.

Example 1:

Input: nums = [1, 3, 5, 4, 7]
Output: 3
Explanation: The longest continuous increasing subsequence is [1, 3, 5] with length 3.

Example 2:

Input: nums = [2, 2, 2, 2, 2]
Output: 1
Explanation: No element is strictly greater than the previous, so length is 1.