Greedy – Activity Selection

Problem Statement:

Given activities with start and end times, select the maximum number of non-overlapping activities.

Greedy Strategy: Always pick the activity that ends earliest and is compatible with the last chosen one.

Step 0: Sort activities by end time.