Dsa
Intervals
Hard
Interval Overlap Calculator
Given a list of intervals, your task is to determine the total amount of time that overlaps among all intervals. An interval is represented by a pair of start and end times. The input is provided as a space-separated string. Print the total overlapping time as an integer.
Example:
Input:
1 3 2 5 4 6
Output:
2
Key concepts
intervalsoverlappingcounting
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