insert = function (intervals, newInterval) {
    const { beforeIndex, before } = getBefore(intervals, newInterval);
    const afterIndex = mergeIntervals(intervals, newInterval, beforeIndex);
    const after = intervals.slice(afterIndex);

    return [...before, newInterval, ...after];
}
https://leetcode.com/problems/insert-interval/
Time O(N) | Space O(N)
@param {number[][]} intervals
@param {number[]} newInterval
@return {number[][]}