Find the largest sum of any contiguous strictly increasing segment in an array.
Given an integer array nums, consider every contiguous subarray whose values are strictly increasing from left to right.
Return the maximum possible sum of such a subarray.
A subarray must consist of consecutive elements, and for every adjacent pair in that subarray, the later element must be greater than the earlier one.
nums.nums contains one or more integers.nums[i] < nums[i + 1].Example 1
Input
nums = [10,20,30,5,10,50]
Output
65
Explanation
The strictly increasing subarray [5,10,50] has sum 65, which is the largest among all ascending subarrays.
Example 2
Input
nums = [12,17,15,13,10,11,12]
Output
33
Explanation
The best ascending subarray is [10,11,12], with sum 33.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.