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 an array of intervals intervals, where each interval is a pair [start, end], merge all overlapping intervals and return a new array of non-overlapping intervals that covers the same ranges. The output may be returned in any order, but an efficient solution should exploit sorting.
def merge_intervals(intervals):