Approach hintTry it first, then revealHide
Copy the intervals that end before the new one, absorb every interval that overlaps it by widening its bounds, then copy the rest. One pass, O(n).
Copy the intervals that end before the new one, absorb every interval that overlaps it by widening its bounds, then copy the rest. One pass, O(n).