Skip to content

Glossary: Coding Interviews in JavaScript

Merge intervals

Also written: mergeSlots

Pattern 13: sort the intervals by start, then join each one to the last when its start is at most the last end. It costs O(n log n).

Where the book teaches it

Related terms

IntervalComparator