Question

I'm trying to wrap my head around the coin change problem, where you try to find the total number of ways $N$ cents can be exchanged using $M$ coins $\{C_1, C_2, ..., C_m\}$.

The recurrence relation is this:

recursion

I'm having difficulty understanding the 3rd line where it says solution[i][j-v[i-1]]. What exactly is this v they are talking about? I understand it's just the array index above the current one being worked on, but I still don't get what this v is. Can anybody explain please?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange
scroll top