Practice · 5 of 5
Peaceful Rooks
CHALLENGE
Difficulty: intermediate+25 XP
**Description:** Count the ways to place k non-attacking rooks on an n x n board
(rooks attack along rows and columns).
**Input:** One line: n k (1 <= k <= n <= 8).
**Output:** One integer — the number of placements.
**Example:** 2 2 -> 2 (main or anti diagonal).
Press Submit to check your solution.
Back to lesson: Practice: Backtracking Problem Set