Back to Practice
#0125

Arrange Letters With Repetition

MediumAptitude25 min20 XP

Problem

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

Why This Matters

Permutation formulas need adjustment when repeated items are indistinguishable.

Examples

Example 1
InputLEVEL
Output30

Divide by factorials of repeated letter counts.

Constraints

  • Return the requested value exactly.
  • Handle the stated edge cases.
  • Keep the solution readable.
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

Divide by factorials of repeated letter counts.

Hidden Test Categories
all unique lettersone repeated letterall same letters