Count numbers (smaller than or equal to N) with given digit sum
Given a number N and a sum S, find the count of numbers upto N that have digit sum equal to S. Examples: Input : N = 100, S = 4 Output : 5 Upto 100 only 5 numbers(4, 13, 22, 31, 40) can produce 4 as their sum of digits. Input : N = 1000, S = 1 Output : 4 Upto 1000 only 4 numbers(1, 10, 100 and 1000)