Longest Continuous Increasing Subsequence
Solution ApproachWas this helpful?
Easy•array•Expected: O(n) time, O(1) space
Problem
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.
Reference solution unlocks after your first submission
Loading...
