Write a function(in pyhton) named sumDigits which takes three parameters: f, t and x.sumDigits, then, finds the smallest integer between f and t (both inclusive)whose sum of digits is x, and returns that integer. For example,sumDigits(20, 30, 9) returns 27, because the smallest integer between 20 and 30whose sum of digits is 9, is 27 (2+7=9):20 -> 2+0 = 221 -> 2+1 = 322 -> 2+2 = 423 -> 2+3 = 524 -> 2+4 = 625 -> 2+5 = 726 -> 2+6 = 827 -> 2+7 = 9 ==> return 27Your function should run for any f, t, and x value. If there is no such number,then return -1.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here