Given n and a numeric base, count the integers x with 0 <= x < base^n whose digits in that base are all distinct. (With base = 10 this is the classic count of numbers with unique digits.) The input is JSON {n, base}.
Input: JSON {n, base}.
Output: Integer — the count of numbers with all-distinct digits.
Input: {"n":2,"base":10}
Output: 91
Explanation: All of 0-99 except the nine repeated-digit numbers.Input: {"n":0,"base":10}
Output: 1
Explanation: Only 0.Input: {"n":1,"base":10}
Output: 10
Explanation: The digits 0 through 9.0<=n<=102<=base<=16