Search topics...
All Problems

Longest Continuous Increasing Subsequence

Solution Approach
Was this helpful?
EasyarrayExpected: 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...