1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 07:21:40 +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>你将得到一个整数数组 <code>matchsticks</code> ,其中 <code>matchsticks[i]</code> 是第 <code>i</code>&nbsp;个火柴棒的长度。你要用 <strong>所有的火柴棍</strong>&nbsp;拼成一个正方形。你 <strong>不能折断</strong> 任何一根火柴棒,但你可以把它们连在一起,而且每根火柴棒必须 <strong>使用一次</strong> 。</p>\n\n<p>如果你能使这个正方形,则返回 <code>true</code> ,否则返回 <code>false</code> 。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例&nbsp;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>示例&nbsp;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>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= matchsticks.length &lt;= 15</code></li>\n\t<li><code>1 &lt;= matchsticks[i] &lt;= 10<sup>8</sup></code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 253,
"likes": 257,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -161,7 +161,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"26.6K\", \"totalSubmission\": \"63.1K\", \"totalAcceptedRaw\": 26558, \"totalSubmissionRaw\": 63090, \"acRate\": \"42.1%\"}",
"stats": "{\"totalAccepted\": \"27.8K\", \"totalSubmission\": \"65.8K\", \"totalAcceptedRaw\": 27752, \"totalSubmissionRaw\": 65849, \"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!",