Insert Interval

Asked at OpenAI · Coding Questions · Difficulty: Medium

Given a set of non-overlapping intervals arranged by their start times, insert a new interval into the list, ensuring that the intervals remain ordered and non-overlapping (merge intervals if necessary).

Loading the problem…