Place n chess queens on an n x n board so that no two queens attack each other: no two share a row, a column or a diagonal. Return how many different ways there are.
For n = 4 there are 2. For n = 1 there is 1, and for n = 2 and n = 3 there are none.
Example 1
Input:
n_queens_count(4)
Output:
2
Example 2
Input:
n_queens_count(1)
Output:
1
0 <= n <= 9No results yet
Run your code to check it against the examples, or submit to run every test.