Mental Model
We want to schedule jobs so that we finish as many as possible before their deadlines, choosing the most profitable ones first.
Analogy: Imagine you have a list of tasks to do before certain times, but you can only do one task at a time. You pick the most rewarding tasks that fit before their deadlines, like fitting puzzle pieces in a limited time.
Jobs: [Job1(profit=20, deadline=2), Job2(profit=15, deadline=2), Job3(profit=10, deadline=1)] Time slots: 1 -> 2 -> 3 -> null Slots empty: _ -> _ -> _
