1 line python

  • 0

    from itertools import groupby
    return 0 if not nums or len(nums) == 0 else max([len(list(num)) for (islarger, num) in groupby([nums[i] < nums[i+1] for i in range(len(nums) - 1)]) if islarger] or [0]) + 1

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.