1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/删除子数组的最大得分 [maximum-erasure-value].html
2022-03-29 12:43:11 +08:00

33 lines
1.1 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个正整数数组 <code>nums</code> ,请你从中删除一个含有 <strong>若干不同元素</strong> 的子数组<strong></strong>删除子数组的 <strong>得分</strong> 就是子数组各元素之 <strong></strong></p>
<p>返回 <strong>只删除一个</strong> 子数组可获得的 <strong>最大得分</strong><em></em></p>
<p>如果数组 <code>b</code> 是数组 <code>a</code> 的一个连续子序列,即如果它等于 <code>a[l],a[l+1],...,a[r]</code> ,那么它就是 <code>a</code> 的一个子数组。</p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>nums = [4,2,4,5,6]
<strong>输出:</strong>17
<strong>解释:</strong>最优子数组是 [2,4,5,6]
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>nums = [5,2,1,2,5,2,1,2,5]
<strong>输出:</strong>8
<strong>解释:</strong>最优子数组是 [5,2,1] 或 [1,2,5]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>
<li><code>1 <= nums[i] <= 10<sup>4</sup></code></li>
</ul>