Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 966 Bytes

_2393. Count Strictly Increasing Subarrays.md

File metadata and controls

42 lines (30 loc) · 966 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : July 29, 2024

Last updated : July 29, 2024


Related Topics : Array, Math, Dynamic Programming

Acceptance Rate : 73.63 %


Solutions

Python

class Solution:
    def countSubarrays(self, nums: List[int]) -> int:
        curr = []
        output = 0
        indx = 0

        for num in nums :
            if curr and curr[-1] >= num :
                curr = []
            curr.append(num)
            output += len(curr)
            indx += 1

        return output