...

/

DIY: Merge Intervals

DIY: Merge Intervals

Problem statement

You are given a list of intervals in the form of start and end times. Your task is to merge as many intervals as possible. Two intervals can be merged if they are overlapping (one begins before the other ends) or adjacent (one starts exactly when the other ends). The output is the resultant list of intervals.

Input

The input is a list of lists. The nested lists contain two integers representing the starting and ending ...

Access this course and 1200+ top-rated courses and projects.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy