Insert Interval — JavaScript medium interview problem
You are given an array of non-overlapping intervals sorted by start, and a new interval. Insert `newInterval` into `intervals` such that intervals remain sorted and non-overlapping (merge if necessary). Return the result.
Tags: intervals
Practice this Arrays problem free in the JS Interview Playground with automated tests and unlockable solutions.