mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 14:12:17 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>我们称一个分割整数数组的方案是 <strong>好的</strong> ,当它满足:</p>\n\n<ul>\n\t<li>数组被分成三个 <strong>非空</strong> 连续子数组,从左至右分别命名为 <code>left</code> , <code>mid</code> , <code>right</code> 。</li>\n\t<li><code>left</code> 中元素和小于等于 <code>mid</code> 中元素和,<code>mid</code> 中元素和小于等于 <code>right</code> 中元素和。</li>\n</ul>\n\n<p>给你一个 <strong>非负</strong> 整数数组 <code>nums</code> ,请你返回 <strong>好的</strong> 分割 <code>nums</code> 方案数目。由于答案可能会很大,请你将结果对 <code>10<sup>9 </sup>+ 7</code> 取余后返回。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>nums = [1,1,1]\n<b>输出:</b>1\n<b>解释:</b>唯一一种好的分割方案是将 nums 分成 [1] [1] [1] 。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>nums = [1,2,2,2,5,0]\n<b>输出:</b>3\n<b>解释:</b>nums 总共有 3 种好的分割方案:\n[1] [2] [2,2,5,0]\n[1] [2,2] [2,5,0]\n[1,2] [2,2] [5,0]\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<b>输入:</b>nums = [3,2,1]\n<b>输出:</b>0\n<b>解释:</b>没有好的分割方案。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>3 <= nums.length <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= nums[i] <= 10<sup>4</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 68,
|
||||
"likes": 72,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.7K\", \"totalSubmission\": \"28.9K\", \"totalAcceptedRaw\": 7682, \"totalSubmissionRaw\": 28859, \"acRate\": \"26.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"8.2K\", \"totalSubmission\": \"30.5K\", \"totalAcceptedRaw\": 8219, \"totalSubmissionRaw\": 30546, \"acRate\": \"26.9%\"}",
|
||||
"hints": [
|
||||
"Create a prefix array to efficiently find the sum of subarrays.",
|
||||
"As we are dividing the array into three subarrays, there are two \"walls\". Iterate over the right wall positions and find where the left wall could be for each right wall position.",
|
||||
|
Reference in New Issue
Block a user