Looking for explanation of logic behind change-making project

Hi there. I haven’t completed all of the JavaScript challenges because I have prior experience with programming in general and JS specifically but I have already completed the first four projects for the JavaScript Algorithms and Data Structures Certification. However, the difficulty of the last one seems incongruous with that of the four others. (If it were up to me I’d have more or less the same thing except the greedy solution would work—that seems far more reasonable given the overall difficulty of the other content.) I did look into this issue and found the following solution:


(^ The forum thinks I might be a spammer which is why I had to do that.)

The problem is that I don’t understand it, although I believe it’s using dynamic programming. (And I’m not going to just reimplement something I don’t understand.) I looked into explanations of change-making algorithms on different sites but the problem is that they deviate from the particulars of the freeCodeCamp project. For example, I saw a change-making algorithm explained on a different site, except it concerns the most efficient way to make change with an infinite amount of each denomination, which doesn’t help me too much. Are there any articles or textbooks out there that dissect the change-making task as specified by the aforementioned project? That is, finite numbers of each denomination and the possibility of failure. Generalization from other, similar algorithms is a possibility but this is one of those areas of programming that I tend to struggle with so I am looking more specifically for an article or part of a book that addresses this variant specifically.

(N.b. the expense of acquiring any book you care to recommend is not an issue for me so recommend anything.)