Your question is Merge Overlapping Intervals. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a list of intervals intervals, where each interval is a pair [start, end] with start <= end, return a new list of intervals after merging all overlapping intervals. The output should contain the smallest possible set of non-overlapping intervals covering the same ranges.
def merge_intervals(intervals):