about | help | code help+videos | done | prefs |
apcsaRecurCoins
Given a positive total # of cents and an array of coin denominations, recursively compute if the total can be reached using a combination of 0 or more coins of those denominations. Each denomination can be used an infinite number of times. EXAMPLE: with quarters, dimes and nickels but no pennies, it's possible to make 70 cents but not 71 cents. HINT: the "smaller problem" is one with a smaller total to reach.apcsaRecurCoins(70, [25, 10, 5]) → true apcsaRecurCoins(71, [25, 10, 5]) → false apcsaRecurCoins(71, [25, 10, 5, 1]) → true ...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: 450
Copyright Nick Parlante 2017 - privacy