Maximum Ascending Subarray Sum
Find the biggest sum of a strictly climbing run with a running sum that restarts whenever the climb breaks.
01The problem
An ascending subarray is a contiguous run where every number is strictly bigger than the one before it. Return the largest possible sum of such a run. A single element counts as a run.
| Input | Output | Why |
|---|---|---|
[10, 20, 30, 5, 10, 50] | 65 | 5 + 10 + 50 |
[12, 17, 15, 13, 10, 11, 12] | 33 | 10 + 11 + 12 |
Constraints: 1 to 100 values, each 1 to 100.
Loading the rest of the lesson…