mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-21 21:16:45 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个长度为 <code>n</code> 的<strong>环形整数数组</strong> <code>nums</code> ,返回<em> <code>nums</code> 的非空 <strong>子数组</strong> 的最大可能和 </em>。</p>\n\n<p><strong>环形数组</strong><em> </em>意味着数组的末端将会与开头相连呈环状。形式上, <code>nums[i]</code> 的下一个元素是 <code>nums[(i + 1) % n]</code> , <code>nums[i]</code> 的前一个元素是 <code>nums[(i - 1 + n) % n]</code> 。</p>\n\n<p><strong>子数组</strong> 最多只能包含固定缓冲区 <code>nums</code> 中的每个元素一次。形式上,对于子数组 <code>nums[i], nums[i + 1], ..., nums[j]</code> ,不存在 <code>i <= k1, k2 <= j</code> 其中 <code>k1 % n == k2 % n</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,-2,3,-2]\n<strong>输出:</strong>3\n<strong>解释:</strong>从子数组 [3] 得到最大和 3\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [5,-3,5]\n<strong>输出:</strong>10\n<strong>解释:</strong>从子数组 [5,5] 得到最大和 5 + 5 = 10\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [3,-2,2,-3]\n<strong>输出:</strong>3\n<strong>解释:</strong>从子数组 [3] 和 [3,-2,2] 都可以得到最大和 3\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == nums.length</code></li>\n\t<li><code>1 <= n <= 3 * 10<sup>4</sup></code></li>\n\t<li><code>-3 * 10<sup>4</sup> <= nums[i] <= 3 * 10<sup>4</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 344,
|
||||
"likes": 361,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"37.2K\", \"totalSubmission\": \"101.5K\", \"totalAcceptedRaw\": 37164, \"totalSubmissionRaw\": 101525, \"acRate\": \"36.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"39.2K\", \"totalSubmission\": \"106.5K\", \"totalAcceptedRaw\": 39249, \"totalSubmissionRaw\": 106512, \"acRate\": \"36.8%\"}",
|
||||
"hints": [
|
||||
"For those of you who are familiar with the <b>Kadane's algorithm</b>, think in terms of that. For the newbies, Kadane's algorithm is used to finding the maximum sum subarray from a given array. This problem is a twist on that idea and it is advisable to read up on that algorithm first before starting this problem. Unless you already have a great algorithm brewing up in your mind in which case, go right ahead!",
|
||||
"What is an alternate way of representing a circular array so that it appears to be a straight array?\r\nEssentially, there are two cases of this problem that we need to take care of. Let's look at the figure below to understand those two cases:\r\n\r\n<br>\r\n<img src=\"https://assets.leetcode.com/uploads/2019/10/20/circular_subarray_hint_1.png\" width=\"700\"/>",
|
||||
|
Reference in New Issue
Block a user