目录
1.最长递增三元子序列
2.最长连续递增序列
1.最长递增三元子序列
题目链接:. - 力扣(LeetCode)

思路:我们只需要设置两个数进行比较就好。设a为nums[0],b 为一个无穷大的数,只要有比a小的数字就赋值a,比a大的数字就赋值b,如果有比b大的数字说明可以组成一个三元子序列直接返回true
代码如下:
class Solution {
    public static   boolean increasingTriplet(int[] nums) {
        int a = nums[0],b = Integer.MAX_VALUE;
        for (int i = 0; i < nums.length; i++) {
            if(nums[i] > b){
                return true;
            } else if (nums[i] < a) {
                a = nums[i];
            }else if(nums[i] > a){ 
                b = nums[i];
            }
        }
        return false;
    }
}2.最长连续递增序列
题目链接:. - 力扣(LeetCode)

思路:双指针遍历
代码:
class Solution {
        public int findLengthOfLCIS(int[] nums) {
           int n = nums.length,ret = 0;
        for (int i = 0; i < n; ) {
            int j = i +1;
            while(j < n && nums[j] >nums[j -1])j++;
            ret = Math.max(ret,j-i);
            i = j;
        }
        return ret;
    }
}
![[ 内网渗透实战篇-2 ] 父域子域架构的搭建与安装域环境判断域控定位组策略域森林架构配置信任关系](https://i-blog.csdnimg.cn/direct/fdcc9a90c40f450f9925b9729debe379.png)

















