Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 911 Bytes

_1800. Maximum Ascending Subarray Sum.md

File metadata and controls

42 lines (31 loc) · 911 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

Acceptance Rate : 61.99 %


Solutions

Python

class Solution:
    def maxAscendingSum(self, nums: List[int]) -> int:
        curr = []
        summ = 0
        maxx = 0
        for num in nums :
            if curr and curr[-1] >= num :
                maxx = max(maxx, summ)
                summ = 0
                curr = []
            curr.append(num)
            summ += num
        return max(maxx, summ)