Embercode
✕
Greedy AlgorithmsQuick quiz

Coin systems

7 questions. Covers Coin systems in Python: when greedy coin change is optimal.

Questions 1 to 5 of 7

  1. 1. What does this print? ``python print(optimal_count([1, 4, 6], 8)) ``
  2. 2. What does this print? ``python print(find_counterexample([1, 4, 6])) ``
  3. 3. Why does greedy_count([5, 10], 3) return -1?
  4. 4. For the coin set 1, 2, 7, 8, what is the largest amount that find_counterexample checks?
  5. 5. The coin set 1, 5, 10, 25 is canonical, so greedy gives the fewest coins for every amount. Is that statement true, and why?

5 question(s) left on this page.