Concept Flow - Greedy vs DP How to Know Which to Apply
Start Problem
Check if problem has optimal substructure?
Yes
Check if problem has overlapping subproblems?
Use DP
Build solution with memo/table
Done
Start by checking if the problem can be broken into smaller problems (optimal substructure). Then check if these smaller problems overlap. If yes, use DP; if no, use Greedy.
