Description
Given a non-negative integer n, return the count of all numbers x in the range 0 <= x < 10^n where x has all unique digits.
Examples
Input:
n = 2Output:
91Explanation:
[0,99] minus duplicates.
Input:
n = 0Output:
1Explanation:
Edge case with minimal input.
Input:
n = 1Output:
10Explanation:
Numbers in range [0, 10) are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. All single-digit numbers have unique digits by definition, so all 10 numbers are valid.
Constraints
- •
0 ≤ n ≤ 8