JAVA ✅|| BEGINNER FRIENDLY 🧠|| 100% BEATS 🚀
IntuitionWe need to find the longest continuous increasing subsequence (LCIS) in a given array. The idea is to keep track of how long the current increasing sub
### Intuition

We need to find the longest continuous increasing subsequence (LCIS) in a given array. The idea is to keep track of how long the current increasing subsequence is while iterating through the array. If the current element is smaller than the next one, the subsequence continues. If not, the sequence ends, and we check if it was the longest sequence so far. This ensures that we capture the longest LCIS by the end of the iteration.

### Approach

1. **Initialization**:
   - Start by setting a variable (`count`) to 1, representing the length of the current increasing subsequence, as any individual element is considered an increasing subsequence of length 1.
   - Another variable (`max_length`) is used to store the longest increasing subsequence found so far.

2. **Iterate through the Array**:
   - For each element, check if it is smaller than the next element.
   - If it is, increment the current sequence's length (`count`).
   - If the sequence breaks (i.e., the next element is smaller or equal), compare the current sequence length (`count`) with `max_length`. If `count` is greater, update `max_length`. Then reset `count` to 1 for the next potential subsequence.

3. **Final Check**:
   - After iterating through the array, perform a final check to account for the case where the longest increasing subsequence is at the end of the array.

### Complexity

- **Time Complexity**: 
   $$O(n)$$
- **Space Complexity**: 
   $$O(1)$$ 

# Code
```java []
class Solution {
    public int findLengthOfLCIS(int[] nums) {
        int ans=-1;
        int count=1;
        for(int i=0; i<nums.length-1; i++){
            if(nums[i]<nums[i+1]){
                count++;
            }else{
                ans= Math.max(ans , count);
                count=1;
            }
        }
        return Math.max(ans,count);
    }
}
```
['Java']