DDSA Solutions

Greedy

121 problems · 79 with full explanations

14 Easy43 Medium17 Hard
Greedy algorithms make locally optimal choices at each step, hoping to reach a global optimum. Greedy works when a problem has the "greedy choice property" and "optimal substructure". Common applications: interval scheduling, activity selection, Huffman coding, and jump game.

How to practice

To practice Greedy problems effectively, start with the Easy problems listed below, trace through each solution on paper, then re-implement without looking. When you can recognise the greedy pattern within 30 seconds of reading a new problem, move on to Medium difficulty. Use the related topic pages and our study guide for a structured progression.

Open the full study guide →

Start here (Easy + explained)

All Greedy problems