Dsa
Intervals
Warm-up
Classroom Overlap Checker
You are given a list of classroom time intervals as pairs of integers. Each pair represents the start and end times of a class in a day. Your task is to determine if any of these classes overlap with each other. Return 'Overlap' if there is at least one overlap, otherwise return 'No Overlap'. Each class's start time is always less than its end time.
Input format:
The input consists of a single line containing pairs of integers where each pair represents the start and end time of a class (e.g., '1 3 2 4 5 7').
Output format:
Return 'Overlap' or 'No Overlap'.
Example:
Input:
1 3 4 5 2 6
Output:
Overlap
Key concepts
intervalsoverlapclassroom
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