When NOT to Use

Avoid forcing this pattern

Avoid forcing this pattern when:

  • Counterexample exists: If you can construct an input where greedy fails, use DP instead.
  • Choices affect future options unpredictably: When current choice changes what's available later in complex ways, greedy often fails.
  • Problem asks for count of ways: Greedy finds one solution; counting requires exhaustive exploration. Remember: forcing a pattern where it doesn't fit leads to overcomplicated solutions.

If you find yourself fighting the approach, step back and reconsider whether another technique works better.