mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个整数数组 <code>nums</code>,有一个大小为 <code>k</code><em> </em>的滑动窗口从数组的最左侧移动到数组的最右侧。你只可以看到在滑动窗口内的 <code>k</code> 个数字。滑动窗口每次只向右移动一位。</p>\n\n<p>返回 <em>滑动窗口中的最大值 </em>。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>nums = [1,3,-1,-3,5,3,6,7], k = 3\n<b>输出:</b>[3,3,5,5,6,7]\n<b>解释:</b>\n滑动窗口的位置 最大值\n--------------- -----\n[1 3 -1] -3 5 3 6 7 <strong>3</strong>\n 1 [3 -1 -3] 5 3 6 7 <strong>3</strong>\n 1 3 [-1 -3 5] 3 6 7 <strong> 5</strong>\n 1 3 -1 [-3 5 3] 6 7 <strong>5</strong>\n 1 3 -1 -3 [5 3 6] 7 <strong>6</strong>\n 1 3 -1 -3 5 [3 6 7] <strong>7</strong>\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>nums = [1], k = 1\n<b>输出:</b>[1]\n</pre>\n\n<p> </p>\n\n<p><b>提示:</b></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>\n\t<li><code>-10<sup>4</sup> <= nums[i] <= 10<sup>4</sup></code></li>\n\t<li><code>1 <= k <= nums.length</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 1501,
|
||||
"likes": 1504,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Minimum Window Substring\", \"titleSlug\": \"minimum-window-substring\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u6700\\u5c0f\\u8986\\u76d6\\u5b50\\u4e32\"}, {\"title\": \"Min Stack\", \"titleSlug\": \"min-stack\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u6700\\u5c0f\\u6808\"}, {\"title\": \"Longest Substring with At Most Two Distinct Characters\", \"titleSlug\": \"longest-substring-with-at-most-two-distinct-characters\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u81f3\\u591a\\u5305\\u542b\\u4e24\\u4e2a\\u4e0d\\u540c\\u5b57\\u7b26\\u7684\\u6700\\u957f\\u5b50\\u4e32\"}, {\"title\": \"Paint House II\", \"titleSlug\": \"paint-house-ii\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u7c89\\u5237\\u623f\\u5b50 II\"}]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"263K\", \"totalSubmission\": \"527.7K\", \"totalAcceptedRaw\": 262958, \"totalSubmissionRaw\": 527670, \"acRate\": \"49.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"264.2K\", \"totalSubmission\": \"530K\", \"totalAcceptedRaw\": 264194, \"totalSubmissionRaw\": 530038, \"acRate\": \"49.8%\"}",
|
||||
"hints": [
|
||||
"How about using a data structure such as deque (double-ended queue)?",
|
||||
"The queue size need not be the same as the window’s size.",
|
||||
|
Reference in New Issue
Block a user