mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-22 21:46:46 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个非空且只包含非负数的整数数组 <code>nums</code>,数组的 <strong>度</strong> 的定义是指数组里任一元素出现频数的最大值。</p>\n\n<p>你的任务是在 <code>nums</code> 中找到与 <code>nums</code> 拥有相同大小的度的最短连续子数组,返回其长度。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,2,3,1]\n<strong>输出:</strong>2\n<strong>解释:</strong>\n输入数组的度是 2 ,因为元素 1 和 2 的出现频数最大,均为 2 。\n连续子数组里面拥有相同度的有如下所示:\n[1, 2, 2, 3, 1], [1, 2, 2, 3], [2, 2, 3, 1], [1, 2, 2], [2, 2, 3], [2, 2]\n最短连续子数组 [2, 2] 的长度为 2 ,所以返回 2 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,2,3,1,4,2]\n<strong>输出:</strong>6\n<strong>解释:</strong>\n数组的度是 3 ,因为元素 2 重复出现 3 次。\n所以 [2,2,3,1,4,2] 是最短子数组,因此返回 6 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>nums.length</code> 在 <code>1</code> 到 <code>50,000</code> 范围内。</li>\n\t<li><code>nums[i]</code> 是一个在 <code>0</code> 到 <code>49,999</code> 范围内的整数。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 401,
|
||||
"likes": 402,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Maximum Subarray\", \"titleSlug\": \"maximum-subarray\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u6700\\u5927\\u5b50\\u6570\\u7ec4\\u548c\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"73.2K\", \"totalSubmission\": \"121.5K\", \"totalAcceptedRaw\": 73218, \"totalSubmissionRaw\": 121533, \"acRate\": \"60.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"73.3K\", \"totalSubmission\": \"121.7K\", \"totalAcceptedRaw\": 73328, \"totalSubmissionRaw\": 121744, \"acRate\": \"60.2%\"}",
|
||||
"hints": [
|
||||
"Say 5 is the only element that occurs the most number of times - for example, nums = [1, 5, 2, 3, 5, 4, 5, 6]. What is the answer?"
|
||||
],
|
||||
|
Reference in New Issue
Block a user