Watch out for these edge cases:
Empty input: : Return (or appropriate default).
Single interval: : Return .
Ties in end time: : If two activities end at the same time, the order between them does not matter. Both are valid greedy choices.
Touching intervals: : and do not overlap. They share a point but can both be selected. Always check the problem statement for whether touching intervals overlap. Common bug: using < instead of <= for overlap check.