Core Idea
Choosing the activity that ends earliest leaves the most room for the remaining choices. This greedy decision is the core of the problem.
Algorithm
Sort activities by finishing time. Take an activity when its start time is at least the finish time of the last selected activity.
Common Mistakes
Be clear about whether touching endpoints are compatible. This problem uses the statement condition directly; do not add extra gaps between activities.