题目:
题解:
func countNumbersWithUniqueDigits(n int) int {
if n == 0 {
return 1
}
if n == 1 {
return 10
}
ans, cur := 10, 9
for i := 0; i < n-1; i++ {
cur *= 9 - i
ans += cur
}
return ans
}