---
# System prepended metadata

title: 1800. Maximum Ascending Subarray Sum
tags: [Leetcode, Easy]

---

# 1800. Maximum Ascending Subarray Sum
###### tags: `Leetcode` `Easy`
Link: https://leetcode.com/problems/maximum-ascending-subarray-sum/description/
## Code
```python=
class Solution:
    def maxAscendingSum(self, nums: List[int]) -> int:
        ans, currSum = 0, 0
        i = 0
        for i in range(len(nums)):
            if i==0 or nums[i]<=nums[i-1]:
                ans = max(ans, currSum)
                currSum = nums[i]
            else: currSum += nums[i]
        ans = max(ans, currSum)
        return ans
```