Practice · 1 of 5
Count Permutations
CHALLENGE
Difficulty: beginner+25 XP
**Description:** Count the permutations of 1..n in which no two adjacent elements
differ by more than 1... simplified for grading: count permutations of 1..n whose
**first element is odd**.
**Input:** One line: n (1 <= n <= 10).
**Output:** One integer — the count.
**Example:** 3 -> 4 (permutations starting with 1 or 3).
Press Submit to check your solution.
Back to lesson: Practice: Backtracking Problem Set