LeetCode 51 N-Queens - Problem Statement

The problem

Place nn queens on an n×nn \times n chessboard so no two queens attack each other.

Queens attack horizontally, vertically, and diagonally.

For n=4n = 4, one solution:

. Q . .
. . . Q
Q . . .
. . Q .

Return all distinct solutions. Each solution is a board configuration.

Constraints: 1n91 \le n \le 9.