Digit sums divisible by d
Your task
Count integers x with L <= x <= R whose digit sum is divisible by d. Use range counting via f(R)-f(L-1). 0 <= L <= R <= 10^12, 1 <= d <= 100. Return the count.
Examples
count_digitsum_divisible(L: int, R: int, d: int) -> intExample 1
Input
count_digitsum_divisible(1, 20, 5)Output
3