Python short 1-liner. Functional programming.
Approach\n1. For each adjacent pairwise numbers in nums check if nums_i < nums_{i + 1} to form a boolean array. (Useful to see bools as 1 and 0).\nlt_bools = st
# Approach\n1. For each adjacent `pairwise` numbers in `nums` check if $$nums_i < nums_{i + 1}$$ to form a boolean array. (Useful to see bools as 1 and 0).\n`lt_bools = starmap(lt, pairwise(nums))`\n\n2. Calculate `running_sums` on the array of bools and reset every time a `0` is found.\n`run_sums = accumulate(lt_bools, lambda a, x: a * x + 1, initial=1)`\n\n3. Return the `max(run_sums) + 1`\n\nExample:\n```python\nnums     = [1, 3, 5, 4, 7, 2, 4, 5, 7, 9]\nlt_bools =   [1, 1, 0, 1, 0, 1, 1, 1, 1]\nrun_sums = [1, 2, 3, 1, 2, 1, 2, 3, 4, 5] # Extra 1 added at the beginning\nlcis_len = 5\n```\n\n# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(1)$$\n\nwhere, `n is length of nums`.\n\n# Code\n```python\nclass Solution:\n    def findLengthOfLCIS(self, nums: list[int]) -> int:\n        return max(accumulate(starmap(lt, pairwise(nums)), lambda a, x: a * x + 1, initial=1))\n\n\n```
['Array', 'Dynamic Programming', 'Prefix Sum', 'Python', 'Python3']