GreedyEvidence Contributing
Greedy Single-Pass Decision
Make a locally optimal choice while scanning once left to right, where the specific decision rule is simple enough not to warrant its own named pattern.
Practice Problems: 8
Difficulty: 0 Easy·7 Medium·1 Hard
Core technique
Review the technique, then try the mapped problems below. The right approach depends on each problem's constraints.
- Core Strategy: Make a locally optimal choice while scanning once left to right, where the specific decision rule is simple enough not to warrant its own named pattern.