You are given an integer n.
Your task is to find the total number of distinct ways to place n chess queens on an n x n chessboard such that no two queens threaten each other.
Note that:
Return the total number of distinct ways.
1
1
For a 1x1 board, there is only one solution: placing the queen at the single cell.
3
0
For a 3x3 board, it's impossible to place 3 queens without any two attacking each other.
4
2
For a 4x4 board, there are two distinct ways to place 4 queens such that no two queens threaten each other.
1
1