Back to problems

Merge Intervals with Names

Algorithm · Google · Medium

Combine intervals as in the standard interval-merging problem, but each resulting time segment must also identify every name whose interval covers that segment. The original question specifically asks how to construct that collection of names. Example The interval from 8 to 10 is covered only by Ana, the span from 10 to 12 is shared by Ana and Ben, and Ben alone covers 12 through 18.

Checking your access…