674. Longest Continuous Increasing Subsequence
https://leetcode.com/problems/longest-continuous-increasing-subsequence/description/
Given an unsorted array of integers, find the length of longest continuous
increasing subsequence (subarray).
Example 1:
Example 2:
Note: Length of the array will not exceed 10,000.
Thoughts
返回数组中最长的递增子数组长度。argmax + subarray => DP或dynamic window。以nums[i]为底,action为是否与前面的拼接,dp存以nums[i]为底最长长度。
Code
Analysis
时间复杂度O(N), 空间O(1).
Last updated
Was this helpful?