N-queens count
Hardbacktrackingrecursion
Return the number of ways to place n queens on an n × n chessboard so that no two attack each other (no shared row, column or diagonal).
Example 1
Input: n = 4 Output: 2
Example 2
Input: n = 1 Output: 1
Constraints
- 1 ≤ n ≤ 10
Submit checks your solution against 8 tests, including hidden ones.
/**
* @param {int} n
* @return {int}
*/
function totalNQueens(n) {
}