Longest Continuous Increasing Subsequence
最长连续递增子序列. local用来表示当前最长递增子序列, max表示全局最长递增子序列
class Solution {
public int findLengthOfLCIS(int[] nums) {
if(nums == null || nums.length == 0)
return 0;
int max = 1;
int local = 1;
for(int i = 1 ; i < nums.length; i++) {
if(nums[i-1] < nums[i]) {
local++;
}
else {
local = 1;
}
max = Math.max(max, local);
}
return max;
}
}