Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Count Numbers with Unique Digits
Bookmark
Input
n = 3
n = 5
n = 8 (max)
n = 0 (edge)
Custom
n
=
3
n =
3
single digits
0–9
are all unique →
10
numbers
unique-digit numbers, counted by digit-length
10
≤1 digit
result =
10
count by digit-length: a leading digit has 9 choices, each next position one fewer
algo
master
.
io
Step:
Count every number x with 0 ≤ x < 10^3 whose digits are all distinct.
0 / 9
Input
n = 3
n = 5
n = 8 (max)
n = 0 (edge)
Custom
n
=
3
0 / 9
n =
3
single digits
0–9
are all unique →
10
numbers
unique-digit numbers, counted by digit-length
10
≤1 digit
result =
10
count by digit-length: a leading digit has 9 choices, each next position one fewer
algo
master
.
io
Step:
Count every number x with 0 ≤ x < 10^3 whose digits are all distinct.