Dsa
Heap
Easy
Meeting Rooms II
You have a list of meeting intervals with start and end times. Your task is to find the minimum number of meeting rooms required to accommodate all meetings without overlaps.
Write a program that reads intervals from input until EOF, where each interval is represented as 'start end' on a new line. Output the minimum number of meeting rooms needed.
Input Format:
- A sequence of meeting intervals, where each line contains two integers representing start and end times.
Output Format:
- An integer representing the minimum number of meeting rooms needed.
Example:
Input:
0 30
5 10
15 20
Output:
2
Key concepts
heapintervalsscheduling
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