Easy Approach HINT

-> think of doing this problem first -> count of n digits numbers whose sum is equal to x.

->First try to think for smaller numbers less than 1000 i.e from 1 to 999.

-> Create the tree for the same i.e numbers less than 999.

-> after finding f(n,sum)(n is the number of digits and sum is the required sum).

-> you can find f(9,sum)for all numbers less than 1000000000.

-> now finally you need to handle for one number 1000000000.

Cheers

*Edited by author 31.07.2020 12:43*