Job Sequencing with Deadlines
Greedy Strategy: Sort jobs by profit (descending)
β’ For each job, find latest free slot before deadline
β’ Schedule job in that slot
Why: High-profit jobs get priority; late slots preserve flexibility
Time: O(nΒ²) or
O(n log n) with union-find