最长连续递增序列

最长连续递增序列(难度:简单)

1578807734778
1578807775519

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Solution {
public int findLengthOfLCIS(int[] nums) {
if(nums.length<=1)
return nums.length;
int count = 1;
int max = 1;
for(int i = 1; i < nums.length; i++){
if(nums[i] > nums[i-1]){
count++;
max = Math.max(max,count);
} else
count=1;
}
return max;
}
}
1578807884555