mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 15:01:40 +08:00
更新国内版力扣题目描述变更
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
<p>Write an algorithm to print all ways of arranging n queens on an n x n chess board so that none of them share the same row, column, or diagonal. In this case, "diagonal" means all diagonals, not just the two that bisect the board.</p>
|
||||
|
||||
<p><strong>Notes: </strong>This problem is a generalization of the original one in the book.</p>
|
||||
|
||||
<p><strong>Example:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong> Input</strong>: 4
|
||||
<strong> Output</strong>: [[".Q..","...Q","Q...","..Q."],["..Q.","Q...","...Q",".Q.."]]
|
||||
<strong> Explanation</strong>: 4 queens has following two solutions
|
||||
[
|
||||
[".Q..", // solution 1
|
||||
"...Q",
|
||||
"Q...",
|
||||
"..Q."],
|
||||
|
||||
["..Q.", // solution 2
|
||||
"Q...",
|
||||
"...Q",
|
||||
".Q.."]
|
||||
]
|
||||
</pre>
|
||||
<p>Write an algorithm to print all ways of arranging n queens on an n x n chess board so that none of them share the same row, column, or diagonal. In this case, "diagonal" means all diagonals, not just the two that bisect the board.</p>
|
||||
|
||||
|
||||
|
||||
<p><strong>Notes: </strong>This problem is a generalization of the original one in the book.</p>
|
||||
|
||||
|
||||
|
||||
<p><strong>Example:</strong></p>
|
||||
|
||||
|
||||
|
||||
<pre>
|
||||
|
||||
<strong> Input</strong>: 4
|
||||
|
||||
<strong> Output</strong>: [[".Q..","...Q","Q...","..Q."],["..Q.","Q...","...Q",".Q.."]]
|
||||
|
||||
<strong> Explanation</strong>: 4 queens has following two solutions
|
||||
|
||||
[
|
||||
|
||||
|
Reference in New Issue
Block a user