Dsa
Intervals
Hard
Find All Gaps in Intervals
Given a list of intervals representing booked time slots, find all the gaps in the time schedule. Each interval is represented as 'start-end'. Consider your schedule as a continuous time frame from the earliest start to the latest end across all intervals. Example: For input '1-3 5-8', the gaps would be '3-5'.
Key concepts
intervalsgapsset operations
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