Practice · 2 of 5
N-Queens Count
CHALLENGE
Difficulty: intermediate+25 XP
**Description:** Count the ways to place n non-attacking queens on an n x n board
(no two share a row, column, or diagonal).
**Input:** One line: n (1 <= n <= 10).
**Output:** One integer — the number of placements.
**Example:** 4 -> 2.
Press Submit to check your solution.
Back to lesson: Practice: Backtracking Problem Set