113. N-Queens (count solutions)
HardRecursion & backtracking
Return how many ways n queens can be placed on an n × n chessboard so that no two attack each other (same row, column or diagonal).
Example 1
Input: n = 4 Output: 2
Example 2
Input: n = 1 Output: 1
Constraints
1 ≤ n ≤ 9