0

Maybe anyone has idea how to solve this problem using dynamic programming: I have a natural number. Let’s name it n. Then, have digits: 1, 3, 4. I have to find all possible sums (with repetitives) of n using digits above. For example.

n=3. Then solution:
1+1+1=3
3=3

I know how to solve this problem using recursion or loops, but I really have no idea how to solve it with dynamic programming. And how to write relation for subproblems.

1 Answers1

1

Hint: condition on the first element in the sum.

Robert Israel
  • 448,999