+ 1
Challenge: Represent any number n in sum of given number
Input any number n and respresent it in the form of sum of given numbers. You can only use this given list of numbers: ( 1, 2, 5, 10, 20, 50, 100, 500, 2000). e.g. 55 = 50 + 5 and so on.. The solution should not be only in sum of 1. 3 = 1+1+1 is wrong but 3 = 2+1 is right. You can not represent the number by sum of 1 only but 1 can be used multiple times. e.g. 4 = 2+1+1 is right. "Only sum is allowed" You don't need to print all the
4 Respuestas
+ 3
https://code.sololearn.com/ckXT9xEo8zH1/?ref=app
+ 2
here goes my try....
https://code.sololearn.com/c9SipoUyNjrT/?ref=app