Back to Practice
#0175

Arrange Letters With Repetition

MediumAptitude25 min20 XP

Problem

How many distinct arrangements can be made from the letters of LEVEL?

Why This Matters

Repeated-item permutations are a frequent aptitude pattern and a bridge to combinatorics.

Examples

Example 1
InputLEVEL
Output30

There are 5 letters, with L repeated twice and E repeated twice: 5!/(2!*2!) = 30.

Constraints

  • Return the exact requested output.
  • Handle ordinary edge cases.
  • Prefer simple, interview-readable code.
CodeReasoning
How many distinct arrangements can be made from the letters of LEVEL?
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core example
InputLEVEL
Expected30

There are 5 letters, with L repeated twice and E repeated twice: 5!/(2!*2!) = 30.

Hidden Test Categories
empty or minimal inputduplicates or tieslarger input