Longest Continuous Increasing Subsequence
IntuitionThe problem asks for the length of the longest continuous increasing subsequence (LCIS) in an array.
To solve this, we traverse the array while keeping
# Intuition
The problem asks for the length of the longest continuous increasing subsequence (LCIS) in an array.
To solve this, we traverse the array while keeping track of an increasing sequence. If we encounter a number smaller than or equal to the previous one, we reset the counter. Throughout, we update the result if we find a longer subsequence.



# Approach
- Initialize two variables: counter to keep track of the current increasing subsequence length and result to store the maximum length found.
- Iterate through the array using a for loop.
- For each element, reset counter to 1, then use a while loop to count the length of the increasing subsequence.
- If the current number is smaller than or equal to the previous one, exit the while loop.
- Update result if counter exceeds the previous result.
- Return result as the final answer.


# Complexity
- Time complexity:
O(n), where n is the length of nums, as each element is visited at most once.

- Space complexity:
O(1), constant space used.

# Code
```cpp []
class Solution {
public:
    int findLengthOfLCIS(vector<int>& nums) {
        int counter = 1;
        int result = 1;
        for(int i = 0; i < nums.size(); i++)
        {
            counter = 1;
            while(i < nums.size() -1 && nums[i+1] > nums[i])
            {
                counter++;
                i++;
            }
            if(result < counter)
                result = counter;
        }
        return result;
    }
};
```
['Array', 'Two Pointers', 'C++']