Day 11 Problem

Intervals is my own personal nightmare

Hello and welcome back brave human being,

Before we dive deep into the problem, I want to remind you: that these interviews are not easy.

They take deliberate practice and dedication, I spent my whole undergrad studying LeetCode and felt completely overwhelmed.

My intention with these emails is to make these problems digestible and show you that with the right insights a Medium problem becomes Easier ðŸ˜‰ .

This is your reminder to not quit.

You have a sorted list of non-overlapping intervals, each defined by a start and end point. Now, you're given a new interval. Your task is to insert this new interval into the existing list while keeping it sorted.

Let's set an example…

Input: intervals = [[1,3],[6,9]], newInterval = [2,5]

Output: [[1,5],[6,9]]

Remember the array is already sorted!

Need help remembering how to merge intervals? -

Remember: One LeetCode problem a day keeps unemployment away!

Cheers to your success,

Denisse

Need motivation to be consistent?

Add this problem to your log and when the challenge is done send it to me! You’ll be in for a treat.

Reply

or to participate.