Dsa
Intervals
Hard
Merging Availability Windows
You are given a list of availability windows represented by intervals, where each interval consists of a start and an end time (in hours). You need to merge overlapping intervals and produce a list of distinct intervals that represent the combined availability. The intervals are given as a space-separated string. Print the merged intervals as a space-separated string.
Example:
Input:
9 12 11 15 16 18 10 14
Output:
9 15 16 18
Key concepts
intervalsschedulingmerging
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