All Digits Different
Count the integers in [1, N] whose decimal digits are all DISTINCT.
Input: one integer N.
Output: the count of repeat-free numbers up to N.
Constraints:
- 1 ≤ N ≤ 1018
Sample Tests
Input 1
20
Output 1
19
Input 2
100
Output 2
90
Discussion (opens after you solve — no spoilers before)
No comments yet.