Using sliding window + lagging pointer concept
Intuition\nUsing Sliding window + lagging pointer concept.\n\n# Approach\nWe need to find the cases for which we update the lagging pointer as we move our slidi
# Intuition\nUsing Sliding window + lagging pointer concept.\n\n# Approach\nWe need to find the cases for which we update the lagging pointer as we move our sliding window.\n- Bad case1: nums[i + 1] > nums[i]\n- Bad case2: when we have reached the end of the array.\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity:O(1)\n# Code\n```\nclass Solution {\n    public int findLengthOfLCIS(int[] nums) {\n        if (nums == null) return 0;\n        int p1 = 0;\n        int max = 0;\n        for (int i = 0; i < nums.length; i++) {\n            // Bad case when we update\n            if (i + 1 == nums.length || nums[i + 1] <= nums[i]) {\n                // max cal\n                max = Math.max(i - p1 + 1, max);\n                // update p1 pointer\n                p1 = i + 1;\n            }\n        }\n        return max;\n    }\n}\n```
['Sliding Window', 'Java']