Queens Placements
Return the number of ways to place n queens on an chessboard so that no two share a row, column or diagonal.
Constraints
Examples
EXAMPLE WALKTHROUGHtwo solutions
A guided view of the published example, not a trace of your code.
INPUT
[4]TASKqueens_placements()
EXPECTED OUTPUT
2Start with the input values shown in this example.
Example 1 of 3
Input: n = 4
Output: 2
Explanation: two solutions
Input: n = 1
Output: 1
Explanation: one queen
Input: n = 2
Output: 0
Explanation: impossible
Hint 1
Place one queen per row.
Hint 2
Track used columns and both diagonals (r - c and r + c) in sets for O(1) checks.