Algorithms in Go: Merge Intervals
- Tutorial
![](https://webcf.waybackmachine.org/web/20210126100458im_/https://habrastorage.org/getpro/habr/upload_files/69e/275/fc3/69e275fc35bba7d4090054384989d152.jpg)
This is the third part of a series covering the implementation of algorithms in Go. In this article, we discuss the Merge Interval algorithm. Usually, when you start learning algorithms you have to deal with some problems like finding the least common denominator or finding the next Fibonacci number. While these are indeed important problems, it is not something that we solve every day. What I like about the Merge Interval algorithm is that we apply it in our everyday life, usually without even noticing that we are solving an algorithmic problem.
Let's say that we need to organize a meeting for our team. We have three colleagues Jay, May, and Ray and their time schedule look as follows (a colored line represents an occupied timeslot):