Mental Model
We want to schedule jobs to get the most profit by finishing them before their deadlines. We pick jobs that pay the most first and fit them in available time slots.
Analogy: Imagine you have several tasks to do before certain times, and each task gives you money. You want to do the most valuable tasks first but only if you can finish them on time, like fitting appointments in a calendar.
Jobs: [Job1: profit=20, deadline=2]
[Job2: profit=15, deadline=2]
[Job3: profit=10, deadline=1]
[Job4: profit=5, deadline=3]
[Job5: profit=1, deadline=3]
Time slots: 1 -> 2 -> 3 -> null
Slots are empty initially: _ -> _ -> _ -> null