Activity Selection

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

Input Format

Integer n
n lines: two integers (start end)

Output Format

Integer (max number of activities)

Sample Input

3
1 2
2 3
3 4

Sample Output

3

Try Your Code

← Back to Problems List