class Solution {
public int findLengthOfLCIS(int[] nums) {
int res = 0;
int left = 0, right = nums.length;
while (left < right){
int count = 1;
while (left < right - 1 && nums[left] < nums[left + 1]){
count++;
left++;
}
res = Math.max (count ,res);
left++;
}
return res;
}
}
力扣674. 最长连续递增序列
最长递增子序列长度
最新推荐文章于 2025-12-02 18:04:47 发布
该博客内容涉及算法问题,主要讲解如何找到整数数组中最长的递增子序列的长度。通过双指针法实现,优化了遍历过程,提高了效率。

661

被折叠的 条评论
为什么被折叠?



