All prompts are owned by LeetCode. To view the prompt, click the title link above.
First completed : July 29, 2024
Last updated : July 29, 2024
Related Topics : Array
Acceptance Rate : 61.99 %
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)