Harshad numbers
Your task
Count how many integers in the inclusive range [1, n] are divisible by their own digit sum (Harshad / Niven numbers). For example 12 qualifies because 12 is divisible by 1+2=3. Constraints: 1 <= n <= 200000. Return the count.
Examples
count_harshad(n: int) -> intExample 1
Input
count_harshad(12)Output
11