Dsa
Greedy
Hard
Unified Meeting Time
You have a series of meetings represented by their start and end times. Your task is to find the optimal time slots to schedule as many meetings as possible such that no two meetings overlap. Write a program that reads these meetings from STDIN and prints the largest number of meetings that can be attended to STDOUT.
Input format: First line contains an integer n (1 <= n <= 1000), number of meetings. Each of the next n lines contains two integers a and b (0 <= a < b <= 10^6) representing the start and end times of the meetings.
Output format: A single integer, the maximum number of non-overlapping meetings.
Example:
Input:
5
1 3
2 4
3 5
0 1
5 7
Output:
4
Key concepts
greedyinterval scheduling
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now