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>matchsticks</code> ,其中 <code>matchsticks[i]</code> 是第 <code>i</code> 个火柴棒的长度。你要用 <strong>所有的火柴棍</strong> 拼成一个正方形。你 <strong>不能折断</strong> 任何一根火柴棒,但你可以把它们连在一起,而且每根火柴棒必须 <strong>使用一次</strong> 。</p>\n\n<p>如果你能使这个正方形,则返回 <code>true</code> ,否则返回 <code>false</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/04/09/matchsticks1-grid.jpg\" /></p>\n\n<pre>\n<strong>输入:</strong> matchsticks = [1,1,2,2,2]\n<strong>输出:</strong> true\n<strong>解释:</strong> 能拼成一个边长为2的正方形,每边两根火柴。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> matchsticks = [3,3,3,3,4]\n<strong>输出:</strong> false\n<strong>解释:</strong> 不能用所有火柴拼成一个正方形。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= matchsticks.length <= 15</code></li>\n\t<li><code>1 <= matchsticks[i] <= 10<sup>8</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 252,
|
||||
"likes": 253,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"26.5K\", \"totalSubmission\": \"62.9K\", \"totalAcceptedRaw\": 26483, \"totalSubmissionRaw\": 62934, \"acRate\": \"42.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"26.6K\", \"totalSubmission\": \"63.1K\", \"totalAcceptedRaw\": 26558, \"totalSubmissionRaw\": 63090, \"acRate\": \"42.1%\"}",
|
||||
"hints": [
|
||||
"Treat the matchsticks as an array. Can we split the array into 4 equal halves?",
|
||||
"Every matchstick can belong to either of the 4 sides. We don't know which one. Maybe try out all options!",
|
||||
|
Reference in New Issue
Block a user