Dynamic Programming Interviews and the Meaning of a State

Dynamic Programming Interviews and the Meaning of a State Define the state and the stopping point Let dp[a] mean the fewest coins needed to make exactly amount a using the permitted denominations. The word exactly matters. A solution that exceeds the target does not satisfy this problem. The base case is dp[0] equal to zero because making zero requires no coins. Other states begin as unreachable.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in