Numbers with repeated digits

Write codeHard35 min

Your task

Given a positive integer n, return the count of integers in the inclusive range [1, n] that have at least one repeated digit. For example for n = 20 only the number 11 qualifies, so the answer is 1. 1 <= n <= 1000000000.

Examples

num_dup_digits_at_most_n(n: int) -> int
Example 1
Inputnum_dup_digits_at_most_n(20)
Output1