Dsa
Intervals
Easy
Merge Overlapping Meetings
You are given a list of meeting time intervals where each interval is represented by a start and an end time. Your task is to merge all overlapping intervals into the smallest possible number of non-overlapping meeting intervals. You should return the merged intervals in order of their start time.
Input Format:
- The first line contains an integer n, the number of intervals.
- The next n lines each contain two integers, representing the start and end time of each meeting interval.
Output Format:
- Print the merged intervals, with each interval on a new line, formatted as "start end".
Example:
Input:
3
1 3
2 4
5 7
Output:
1 4
5 7
Key concepts
intervalsmergingscheduling
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