Count Numbers with Unique Digits
Given an integer n, return the count of all numbers with unique digits, x, where 0 <= x < 10^n.
Example 1
Input
n = 2Output
91The total numbers in the range 0 <= x < 100 excluding repeated-digit numbers like 11, 22, 33, 44, 55, 66, 77, 88, and 99 is 91.
Example 2
Input
n = 0Output
1When n = 0, the range is 0 <= x < 1, so only 0 is counted.
Constraints
- 0 <= n <= 8