Determine whether a greedy approach is provably correct for your problem and design the right greedy choice with a proof sketch.
## CONTEXT Greedy algorithms are seductive because they are simple and fast, but they are only correct when the problem has the greedy-choice property and optimal substructure, and applying them blindly produces wrong answers that pass small tests. The hard skill is recognizing when greedy works, choosing the right…
Premium Prompt
Unlock this prompt — and all 25,000+ expert-crafted prompts — with Pro.
Unlock with Pro