Practice · 3 of 5
Distinct Arrangements
CHALLENGE
Difficulty: intermediate+25 XP
**Description:** Count the distinct permutations of the given multiset of characters
(duplicates collapse). Print the count.
**Input:** One line: s (1 <= |s| <= 10, lowercase letters).
**Output:** One integer — the number of distinct arrangements.
**Example:** aab -> 3 (aab, aba, baa).
Press Submit to check your solution.
Back to lesson: Practice: Backtracking Problem Set