This question evaluates array and interval manipulation skills, algorithmic problem-solving, and the ability to reason about merging overlapping ranges in a sorted sequence.
You are given a list of pairwise non-overlapping closed intervals [si, ei] sorted by start time, and a new interval [s, e]. Insert [s, e] into the list so that the result remains sorted and contains no overlaps (merge when necessary). Return the resulting list of intervals. Analyze time and space complexity and cover edge cases such as insertion at the beginning/end, full containment, and an empty input list.