Greedy Patterns
Greedy Patterns
A greedy algorithm makes the best local move at each step.
Key requirement
You must justify why local best leads to global best.
Practice
- Jump Game
- Partition Labels
- Best Time to Buy and Sell Stock
A greedy algorithm makes the best local move at each step.
You must justify why local best leads to global best.