Given a sum s find the smallest 5 digit number whose sum of digits is s
Answers
Answered by
0
Answer:
Find smallest number with given number of digits and sum of digits
How to find the smallest number with given digit sum s and number of digits d?
Examples :
Input : s = 9, d = 2
Output : 18
There are many other possible numbers
like 45, 54, 90, etc with sum of digits
as 9 and number of digits as 2. The
smallest of them is 18.
Input : s = 20, d = 3
Output : 299
Step-by-step explanation:
Similar questions