mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-25 14:58:56 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>石子游戏中,爱丽丝和鲍勃轮流进行自己的回合,<strong>爱丽丝先开始</strong> 。</p>\n\n<p>有 <code>n</code> 块石子排成一排。每个玩家的回合中,可以从行中 <strong>移除</strong> 最左边的石头或最右边的石头,并获得与该行中剩余石头值之 <strong>和</strong> 相等的得分。当没有石头可移除时,得分较高者获胜。</p>\n\n<p>鲍勃发现他总是输掉游戏(可怜的鲍勃,他总是输),所以他决定尽力 <strong>减小得分的差值</strong> 。爱丽丝的目标是最大限度地 <strong>扩大得分的差值</strong> 。</p>\n\n<p>给你一个整数数组 <code>stones</code> ,其中 <code>stones[i]</code> 表示 <strong>从左边开始</strong> 的第 <code>i</code> 个石头的值,如果爱丽丝和鲍勃都 <strong>发挥出最佳水平</strong> ,请返回他们 <strong>得分的差值</strong> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>stones = [5,3,1,4,2]\n<strong>输出:</strong>6\n<strong>解释:</strong>\n- 爱丽丝移除 2 ,得分 5 + 3 + 1 + 4 = 13 。游戏情况:爱丽丝 = 13 ,鲍勃 = 0 ,石子 = [5,3,1,4] 。\n- 鲍勃移除 5 ,得分 3 + 1 + 4 = 8 。游戏情况:爱丽丝 = 13 ,鲍勃 = 8 ,石子 = [3,1,4] 。\n- 爱丽丝移除 3 ,得分 1 + 4 = 5 。游戏情况:爱丽丝 = 18 ,鲍勃 = 8 ,石子 = [1,4] 。\n- 鲍勃移除 1 ,得分 4 。游戏情况:爱丽丝 = 18 ,鲍勃 = 12 ,石子 = [4] 。\n- 爱丽丝移除 4 ,得分 0 。游戏情况:爱丽丝 = 18 ,鲍勃 = 12 ,石子 = [] 。\n得分的差值 18 - 12 = 6 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>stones = [7,90,5,1,100,10,10,2]\n<strong>输出:</strong>122</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == stones.length</code></li>\n\t<li><code>2 <= n <= 1000</code></li>\n\t<li><code>1 <= stones[i] <= 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 58,
|
||||
"likes": 60,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"5.1K\", \"totalSubmission\": \"9.5K\", \"totalAcceptedRaw\": 5064, \"totalSubmissionRaw\": 9496, \"acRate\": \"53.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"5.2K\", \"totalSubmission\": \"9.6K\", \"totalAcceptedRaw\": 5151, \"totalSubmissionRaw\": 9632, \"acRate\": \"53.5%\"}",
|
||||
"hints": [
|
||||
"The constraints are small enough for an N^2 solution.",
|
||||
"Try using dynamic programming."
|
||||
|
||||
Reference in New Issue
Block a user