Mental Model
Greedy algorithm makes the locally optimal choice at each step hoping it leads to a global optimum. It works when the problem has the 'greedy choice property' and optimal substructure.
Analogy: Making change for a dollar: always using the largest coin possible (quarter first) works for US coins, but for weird denominations like 1,3,4 cents for 6 cents, picking 4 then two 1s (3 coins) is worse than two 3s (2 coins).
Target: 6 cents Coins: [4] [3] [3] [1] [1] Greedy: pick 4 -> rem 2 -> 1 -> 1 (3 coins) Optimal: pick 3 -> 3 (2 coins)
