n = 1
Input
1
Output
[['Q']]
Only one cell and one queen — the single solution is a board with 'Q'.
Full lesson preview
Place N queens on an N×N board so that no two queens attack each other.
Problem statement
Task
Examples
Input
1
Output
[['Q']]
Only one cell and one queen — the single solution is a board with 'Q'.
Input format
Output format
Constraints
Samples
Input
4
Output
[['..Q.', 'Q...', '...Q', '.Q..'], ['.Q..', '...Q', 'Q...', '..Q.']]
Two distinct 4x4 solutions. The returned list is sorted lexicographically.