Medium · Math & Number Theory · about 15 minutes
Asked at Google, Amazon, Microsoft.
Given n (0 ≤ n ≤ 8), return how many integers x with 0 ≤ x < 10ⁿ have all distinct digits.
n
x
0 ≤ x < 10ⁿ