Dsa
Intervals
Medium
Interval Coverage Check
Given a list of intervals, determine if the entire range from the minimum start value to the maximum end value is covered by the intervals without any gaps. The function should read from standard input the number of intervals followed by the intervals themselves and output 'Yes' if the entire range is covered, otherwise output 'No'.
Input Format:
- The first line contains an integer N (1 <= N <= 1000), the number of intervals.
- The next N lines each contain two integers representing the start and end of an interval.
Output Format:
- 'Yes' or 'No'.
Example Input:
3
1 2
2 3
3 4
Example Output:
Yes
Key concepts
intervalscoverageboolean
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