N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. A queen can attack horizontally, vertically, and diagonally.

Return all distinct solutions to the n-queens puzzle. Each solution has a distinct board configuration where 'Q' represents a queen and '.' represents an empty cell.

Examples
Input: 1
Output: [["Q"]]
Hints

N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. A queen can attack horizontally, vertically, and diagonally.