1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 22:13:28 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个正整数数组 <code>nums</code> ,请你从中删除一个含有 <strong>若干不同元素</strong> 的子数组<strong>。</strong>删除子数组的 <strong>得分</strong> 就是子数组各元素之 <strong>和</strong> 。</p>\n\n<p>返回 <strong>只删除一个</strong> 子数组可获得的 <strong>最大得分</strong><em> 。</em></p>\n\n<p>如果数组 <code>b</code> 是数组 <code>a</code> 的一个连续子序列,即如果它等于 <code>a[l],a[l+1],...,a[r]</code> ,那么它就是 <code>a</code> 的一个子数组。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [4,2,4,5,6]\n<strong>输出:</strong>17\n<strong>解释:</strong>最优子数组是 [2,4,5,6]\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [5,2,1,2,5,2,1,2,5]\n<strong>输出:</strong>8\n<strong>解释:</strong>最优子数组是 [5,2,1] 或 [1,2,5]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= nums[i] <= 10<sup>4</sup></code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 39,
"likes": 42,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"8.7K\", \"totalSubmission\": \"17.8K\", \"totalAcceptedRaw\": 8696, \"totalSubmissionRaw\": 17836, \"acRate\": \"48.8%\"}",
"stats": "{\"totalAccepted\": \"9.2K\", \"totalSubmission\": \"18.6K\", \"totalAcceptedRaw\": 9180, \"totalSubmissionRaw\": 18635, \"acRate\": \"49.3%\"}",
"hints": [
"The main point here is for the subarray to contain unique elements for each index. Only the first subarrays starting from that index have unique elements.",
"This can be solved using the two pointers technique"