1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 00:11:41 +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>设计一种算法,打印 N 皇后在 N &times; N 棋盘上的各种摆法,其中每个皇后都不同行、不同列,也不在对角线上。这里的&ldquo;对角线&rdquo;指的是所有的对角线,不只是平分整个棋盘的那两条对角线。</p>\n\n<p><strong>注意:</strong>本题相对原题做了扩展</p>\n\n<p><strong>示例:</strong></p>\n\n<pre><strong> 输入</strong>4\n<strong> 输出</strong>[[&quot;.Q..&quot;,&quot;...Q&quot;,&quot;Q...&quot;,&quot;..Q.&quot;],[&quot;..Q.&quot;,&quot;Q...&quot;,&quot;...Q&quot;,&quot;.Q..&quot;]]\n<strong> 解释</strong>: 4 皇后问题存在如下两个不同的解法。\n[\n&nbsp;[&quot;.Q..&quot;, &nbsp;// 解法 1\n&nbsp; &quot;...Q&quot;,\n&nbsp; &quot;Q...&quot;,\n&nbsp; &quot;..Q.&quot;],\n\n&nbsp;[&quot;..Q.&quot;, &nbsp;// 解法 2\n&nbsp; &quot;Q...&quot;,\n&nbsp; &quot;...Q&quot;,\n&nbsp; &quot;.Q..&quot;]\n]\n</pre>\n",
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 131,
"likes": 139,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"21.2K\", \"totalSubmission\": \"27.6K\", \"totalAcceptedRaw\": 21168, \"totalSubmissionRaw\": 27567, \"acRate\": \"76.8%\"}",
"stats": "{\"totalAccepted\": \"22K\", \"totalSubmission\": \"28.7K\", \"totalAcceptedRaw\": 22035, \"totalSubmissionRaw\": 28718, \"acRate\": \"76.7%\"}",
"hints": [
"我们知道每一行都有一个皇后。你能试试所有的可能性吗?",
"每行都必须有个皇后。从最后一行开始。有8个不同的列你可以放皇后。你能挨个试试吗",