Dsa
Intervals
Easy
Available Time Slots
You are a meeting coordinator tasked with finding available slots for scheduling meetings. Given a list of busy time intervals for a single room, determine the time slots available for scheduling new meetings of a specified length. Print the available slots in (start, end) format.
Input Format:
- The first line contains an integer n (1 <= n <= 100) - the number of busy intervals.
- The next n lines each contain two integers: the start and end of each busy interval.
- The last line contains a single integer m (1 <= m <= 10^3) - the desired meeting length.
Output Format:
- Print available time slots in the form 'start end' for each available slot.
Example:
Input:
3
1 2
3 5
6 8
2
Output:
0 1
2 3
5 6
8 10
Key concepts
intervalsgreedyscheduling
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