DEV Community

Paolo Ventura
Paolo Ventura

Posted on

100 algos in 100 days (Day 25)

[10/10]

Dynamic programming

Question

Compute all the combinations of change that could make a certain amount

image

I really struggled with this one as surprisingly it is quite a complex solution. I am improving in understanding that in breaking down the problem into simpler problems we can dynamically program. For example in this one the key was to build up from how many coins can we use to make $1, how many for $2, how many for $3.

Also starting with a recursive solution can help your mind to think of the bottom up solution.... Although not quite there yet!

Top comments (0)