Insert an Interval

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • medium
  • Pro

You have a list of non-overlapping time ranges, already sorted by start. Insert one new range, merging it with any it overlaps, so the list stays sorted and non-overlapping. Explain how to do it in a single pass.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →