about | help | code help+videos | done | prefs |
makeChange
We want try and make exact change with the coins we have. We have only pennies and nickels. Return the number of pennies to use, assuming we always use as many nickels as we can. Return -1 if it can't be done. makeChange(4, 1, 9) → 4 makeChange(4, 1, 10) → -1 makeChange(4, 1, 7) → 2 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 14
Copyright Nick Parlante 2017 - privacy