How Greedy Algorithms Work
A greedy algorithm makes whatever choice looks best at each step, without reconsidering it later. For making change with coins, one common greedy approach always picks the largest coin that still fits. But depending on which coin denominations are available, this greedy choice doesn't always end up using the fewest coins.
Paying 7 with coins 1, 3, and 4, which coins does greedy pick?