You are given an array of non-overlapping intervals sorted in ascending order by the start value, and a new interval. Insert the new interval into the list, merging overlapping intervals as needed, while maintaining the sorted order. Return the updated list of intervals.
Click Run to execute sample tests.