[Solution]Problem 53:Merge Overlapping Intervals[Snapchat]
Keep at it my hard working reader. We're about to do amazing things together.
To learn more about the newsletter, check our detailed About Page + FAQs
To help me understand you better, please fill out this anonymous, 2-min survey. If you liked this post, make sure you hit the heart icon in this email.
Recommend this publication to Substack over here
How is it going my favorite person on the internet,
I love that you show up regularly to nerd it out with me. I’ve been going over the usage stats and some of you madlads have opened my emails 50 times in the last week. Y’all are reading every email, and clicking the links to read the older ones I link/mention. I have no words. Keep showing up consistently, and you’ll be demons in no time.
This engagement and support push me to keep things going and produce the highest quality content for you. Let’s ride this momentum, all the way to the top.
Problem
This problem was asked by Snapchat.
Given a list of possibly overlapping intervals, return a new list of intervals where all overlapping intervals have been merged.
The input list is not necessarily ordered in any way.
For example, given [(1, 3), (5, 8), (4, 10), (20, 25)], you should return [(1, 3), (4, 10), (20, 25)].
Keep reading with a 7-day free trial
Subscribe to Technology Made Simple to keep reading this post and get 7 days of free access to the full post archives.