Problem
Imagine you are an event coordinator at a bustling convention center, responsible for scheduling meetings in a single, highly demanded conference room. You have a list of meetings, each defined by a start time and an end time. Your task is to organize these meetings in a manner that maximizes the number of meetings held without any overlap, meaning no two meetings can occur simultaneously. A meeting [s1, e1] does not overlap with another meeting [s2, e2] if one ends before or when the other starts (e1 <= s2 or e2 <= s1). To tackle this problem, follow these steps: 1. Analyze the list of meetings and their respective start and end times. 2. Determine a strategy to select the maximum number of non-overlapping meetings. 3. Implement an algorithm, possibly using a greedy approach, to schedule these meetings optimally. Consider an example where you have meetings: [1, 3], [2, 4], [3, 5]. The optimal solution would be to schedule meetings [1, 3] and [3, 5], allowing two meetings to be held. Remember, edge cases such as meetings with the same start and end times or overlapping time slots need careful consideration.
Input format
The first line contains an integer n (1 <= n <= 1000), the number of meetings. Each of the next n lines contains two integers s and e (0 <= s < e <= 10000), representing the start and end times of a meeting.
Output format
A single integer representing the maximum number of non-overlapping meetings that can be scheduled.
Constraints
1 <= n <= 1000, 0 <= s < e <= 10000
Sample input
3 1 3 2 4 3 5
Sample output
2