Can anybody have solution for finding Deci-Binary ( Decimal numbers contains 0 and 1 like 100 111 101 ,.etc and numbers like 12, 13 and 5551 are not Deci-Binary)
Numbers used here are decimal only nothing is in Binary format.
Output is not in Binary format. Sum of all numbers in output should be same as Input. For example below Input is Decimal 4 and output is decimals 1,1,1 and 1. When adding all the output we can get the input.
If input is 11 then, that is a deci-binary so we don't want to convert it. so the output will be same as input 11.
For input 4
Output should be 1 1 1 1
Other scenarios as below
IP: 4
OP: 1 1 1 1
IP: 21
OP: 10 11
IP: 11
OP: 11
IP: 100
OP: 100
IP: 99
OP: 11 11 11 11 11 11 11 11 11
I tried, could not resolve it.
EDIT: This is not duplicate of Finding shortest combinations in array/sequence that equals sum my question is not a sub-set problem and completly different form that question