1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 14:12:17 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给出一些不同颜色的盒子<meta charset=\"UTF-8\" />&nbsp;<code>boxes</code>&nbsp;,盒子的颜色由不同的正数表示。</p>\n\n<p>你将经过若干轮操作去去掉盒子,直到所有的盒子都去掉为止。每一轮你可以移除具有相同颜色的连续 <code>k</code> 个盒子(<code>k&nbsp;&gt;= 1</code>),这样一轮之后你将得到 <code>k * k</code> 个积分。</p>\n\n<p>返回 <em>你能获得的最大积分和</em>&nbsp;。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>boxes = [1,3,2,2,2,3,4,3,1]\n<strong>输出:</strong>23\n<strong>解释:</strong>\n[1, 3, 2, 2, 2, 3, 4, 3, 1] \n----&gt; [1, 3, 3, 4, 3, 1] (3*3=9 分) \n----&gt; [1, 3, 3, 3, 1] (1*1=1 分) \n----&gt; [1, 1] (3*3=9 分) \n----&gt; [] (2*2=4 分)\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>boxes = [1,1,1]\n<strong>输出:</strong>9\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>boxes = [1]\n<strong>输出:</strong>1\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= boxes.length &lt;= 100</code></li>\n\t<li><code>1 &lt;= boxes[i]&nbsp;&lt;= 100</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 336,
"likes": 338,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Strange Printer\", \"titleSlug\": \"strange-printer\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u5947\\u602a\\u7684\\u6253\\u5370\\u673a\"}]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"15.9K\", \"totalSubmission\": \"25.5K\", \"totalAcceptedRaw\": 15893, \"totalSubmissionRaw\": 25464, \"acRate\": \"62.4%\"}",
"stats": "{\"totalAccepted\": \"16K\", \"totalSubmission\": \"25.7K\", \"totalAcceptedRaw\": 16036, \"totalSubmissionRaw\": 25748, \"acRate\": \"62.3%\"}",
"hints": [],
"solution": null,
"status": null,