Inserting and merging a new interval into a set of intervals

Medium

Given a sorted set of intervals (sorted based on the 1st value of a given range) that do not overlap, write a function to insert a new interval into the set of intervals. You can merge values in the sorted set to accommodate the new interval. Below are a few examples:...

Sign in to InterviewQs to view this question

Or

New to InterviewQs? Sign up now.

By proceeding, you agree to our Terms and Conditions and Privacy Policy.

Loading editor...