题目链接:https://leetcode.com/problems/longest-continuous-increasing-subsequence/description/ class Solution { public : int findLengthOfLCIS(vector int nums) { int n = nums.size(); if (n= 1 ) return n; int res = 1 , len= 1 ; for ( int
题目链接:https://leetcode.com/problems/longest-continuous-increasing-subsequence/description/
class Solution { public: int findLengthOfLCIS(vector<int>& nums) { int n = nums.size(); if(n<=1) return n; int res = 1, len=1; for(int i=1; i<n; i++){ if(nums[i] > nums[i-1]) len+=1; else len = 1; res = max(len, res); } return res; } };