There are only 10 digits. When `n >= 10`

the return value will not change. So there are only 10 possible results.

DP is not clever enough. Just pre-calculate and cache.

```
public class Solution {
static int[] cache = new int[]{10, 91, 739, 5275, 32491, 168571, 712891, 2345851, 5611771, 8877691};
public int countNumbersWithUniqueDigits(int n) {
if (n == 0) return 1;
else if (n > 10) return cache[9];
return cache[n - 1];
}
}
```