DSD Numbers

0

0 votes
Problem

Bob likes DSD Numbers.DSD Number is a number which is divisible by its Digit Sum in Decimal Representation.

digitSum(n) : Sum of digits of n (in Decimal Representation)

eg: n = 1234 then digitSum(n) = 1 + 2 + 3 + 4 = 10

DSD Number is number n such that n % digitSum(n) equal to 0

Bob asked Alice to tell the number of DSD Numbers in range [L,R] inclusive. Alice does not know the answer,So she asked her Coder friend i.e you for the help. Help Her !!

Constraints:

1 <= test cases <= 50

1<=L<=R<=10^9

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?