- 1) end index in existing interval; reuse the existing interval end to close new range - 2) end index in the gap of 2 intervals, use new interval.end to close the new range - 因为interval已经sort, ...
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to their start times.