class Solution {
public:
int findLengthOfLCIS(vector<int>& nums) {
int n = nums.size();
if(n == 1) return 1;
int result = 1;
vector<int> dp(n, 1);
for(int i = 1; i < n; i++) {
if(nums[i] > nums[i-1]) {
dp[i] = dp[i-1] + 1;
}
result = max(result, dp[i]);
}
return result;
}
};
class Solution {
public:
int findLengthOfLCIS(vector<int>& nums) {
int n = nums.size();
if(n == 1) return 1;
int result = 1;
int count = 1;
for(int i = 1; i < n; i++) {
if(nums[i] > nums[i-1]) {
count++;
} else {
count = 1;
}
result = max(result, count);
}
return result;
}
};