mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-13 01:15:14 +08:00
39 lines
1.1 KiB
HTML
39 lines
1.1 KiB
HTML
<p>给你一个正整数组成的数组 <code>nums</code> ,返回 <code>nums</code> 中一个 <span data-keyword="strictly-increasing-array">严格递增子数组</span> 的最大可能元素和。</p>
|
||
|
||
<p>子数组是数组中的一个连续数字序列。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>nums = [10,20,30,5,10,50]
|
||
<strong>输出:</strong>65
|
||
<strong>解释:</strong>[5,10,50] 是元素和最大的升序子数组,最大元素和为 65 。
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>nums = [10,20,30,40,50]
|
||
<strong>输出:</strong>150
|
||
<strong>解释:</strong>[10,20,30,40,50] 是元素和最大的升序子数组,最大元素和为 150 。
|
||
</pre>
|
||
|
||
<p><strong>示例 3:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>nums = [12,17,15,13,10,11,12]
|
||
<strong>输出:</strong>33
|
||
<strong>解释:</strong>[10,11,12] 是元素和最大的升序子数组,最大元素和为 33 。
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= nums.length <= 100</code></li>
|
||
<li><code>1 <= nums[i] <= 100</code></li>
|
||
</ul>
|