You are given two numeric strings
num1
andnum2
and two integersmax_sum
andmin_sum
. We denote an integerx
to be good if:
num1 <= x <= num2
min_sum <= digit_sum(x) <= max_sum
.Return the number of good integers. Since the answer may be large, return it modulo
109 + 7
.Note that
digit_sum(x)
denotes the sum of the digits ofx
.
c++
1 |
|