Chapter 4 Question about the coin change problem

#1

Could someone explain in more detail how we came to the conclusion:
"if u <= V+ 1, we can still produce every value up to and including V+u and we cannot produce V+u+1"
page 29 of the Java book

Thanks!

Edit: Ok I actually kinda get it now. You can think of u as the new reference point. The original collection “can produce every value up to V”. You can get the values up to V+u by adding u to the previously created values [1, V].

0 Likes

#2

Hey @fondant,

Feel free to let us know if you still confused about this question.

0 Likes