Your intuition can mislead you. Consider making change for cents with coins of , , and cent. Greedy (take largest first) gives: + + + + + = coins. But + + = coins. Greedy gave the wrong answer!
Without a proof technique, you might submit a greedy solution that fails on hidden test cases. The techniques in this section will help you catch these errors before submission. You will learn when greedy works and when it does not.