# Course Schedule III (LC5422)

## Problem
Maximize number of courses you can take given duration and lastDay for each.

## Approach
Sort by lastDay. Greedy take courses; if overload, drop the longest duration so far via max-heap.

## Complexity
O(n log n).

## Practice
Greedy + heap scheduling — [Linkjob](https://www.linkjob.ai/).

## Notes
- Sort key is deadline
- Heap of durations taken
- Time cursor accumulates
