The idea is to use `cnt`

to record the length of the current continuous increasing subsequence which ends with `nums[i]`

, and use `res`

to record the maximum `cnt`

.

Java version:

```
public int findLengthOfLCIS(int[] nums) {
int res = 0, cnt = 0;
for(int i = 0; i < nums.length; i++){
if(i == 0 || nums[i-1] < nums[i]) res = Math.max(res, ++cnt);
else cnt = 1;
}
return res;
}
```

C++ version:

```
int findLengthOfLCIS(vector<int>& nums) {
int res = 0, cnt = 0;
for(int i = 0; i < nums.size(); i++){
if(i == 0 || nums[i-1] < nums[i]) res = max(res, ++cnt);
else cnt = 1;
}
return res;
}
```