------
## 最终结论
```python
def countNumbersWithUniqueDigits(n: int) -> int:
    if n == 0:
        return 1
    if n == 1:
        return 10
    
    count = 10  # Count for n = 1
    unique_digits = 9  # Digits from 1 to 9
    available_numbers = 9  # Digits from 0 to 9 excluding the first digit

    for i in range(2, n + 1):
        unique_digits *= available_numbers
        count += unique_digits
        available_numbers -= 1

    return count

# Test cases
print(countNumbersWithUniqueDigits(0))  # Output: 1
print(countNumbersWithUniqueDigits(1))  # Output: 10
print(countNumbersWithUniqueDigits(2))  # Output: 91
print(countNumbersWithUniqueDigits(3))  # Output: 739
print(countNumbersWithUniqueDigits(4))  # Output: 5275
print(countNumbersWithUniqueDigits(5))  # Output: 32491
print(countNumbersWithUniqueDigits(6))  # Output: 168571
print(countNumbersWithUniqueDigits(7))  # Output: 712891
print(countNumbersWithUniqueDigits(8))  # Output: 2345851
print(countNumbersWithUniqueDigits(9))  # Output: 5611771
```