Skip to content

Glossary: Coding Interviews in Go

Merge intervals

Also written: pattern 13

Combining overlapping time slots by sorting them by start and joining each slot to the last one when `start <= last.end`. It costs O(n log n).

Where the book teaches it

Related terms

Intervalcmp.Compareslices.SortFunc