Given a sorted list of non-overlapping closed intervals, represented as pairs [left, right], and a new closed interval [insert_left, insert_right], insert the new interval into the list such that the resulting list remains sorted and non-overlapping (merging intervals as necessary). Return the resulting list of intervals.
Example 1
Input: interval_list=[[2,4],[7,10]], insert_interval=[5,6]
Output: [[2,4],[5,6],[7,10]]
Explanation: The new interval [5,6] does not overlap with any existing intervals and is inserted between them.
Example 2
Input: interval_list=[[1,2],[3,4],[5,7]], insert_interval=[4,6]
Output: [[1,2],[3,7]]
Explanation: The new interval [4,6] overlaps with [3,4] and [5,7], so they are merged into [3,7].
Example 3
Input: interval_list=[], insert_interval=[0,1]
Output: [[0,1]]
Explanation: Empty interval list, so the result is just the new interval.
Constraints
Case 1
Input: interval_list=[[10,12],[15,18]], insert_interval=[13,14]
Expected: [[10,12],[13,14],[15,18]]
Case 2
Input: interval_list=[[1,5],[8,10]], insert_interval=[6,7]
Expected: [[1,5],[6,7],[8,10]]
Case 3
Input: interval_list=[[1,3],[6,8]], insert_interval=[2,7]
Expected: [[1,8]]
Case 4
Input: interval_list=[[2,3],[5,7],[8,10]], insert_interval=[4,9]
Expected: [[2,3],[4,10]]
Case 5
Input: interval_list=[[1,2],[3,4],[5,6]], insert_interval=[0,7]
Expected: [[0,7]]