Arrays

Insert Interval

medium
You are given an array of non-overlapping intervals sorted by start, and a new interval. Insert `newInterval` into `intervals` such that intervals remain sorted and non-overlapping (merge if necessary). Return the result.
Hint steps(0/2 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.