Math, asked by AnushaNath3939, 1 year ago

Find smallest number with given number of digits and sum of digits

Answers

Answered by NidhiGodhani
0
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

Similar questions