Algorithm · ByteDance · Medium
Two programming tasks are presented below. Task 1: Merging overlapping intervals You are given a collection of intervals. Each interval is an ordered pair [start, end] with $$start \le end$$, and the interval is closed, meaning both endpoints belong to the interval. Intervals overlap if they share at least one point; touching at an endpoint counts as overlap. Return a list of intervals after merging all overlapping intervals. The result must be sorted in nondecreasing order…
Checking your access…