Find the smallest number whose sum of digits is N | Function to find the smallest number whose sum of digits is also N ; Driver code
def smallestNumber ( N ) : NEW_LINE INDENT print ( ( N % 9 + 1 ) * pow ( 10 , ( N // 9 ) ) - 1 ) NEW_LINE DEDENT N = 10 NEW_LINE smallestNumber ( N ) NEW_LINE