Bird
Raised Fist0

Given the merged intervals [[1,5],[6,9]] after inserting a new interval, which of the following could be the original intervals and new interval?

hard🔄 Reverse Engineer Q9 of Q15
Intervals - Insert Interval
Given the merged intervals [[1,5],[6,9]] after inserting a new interval, which of the following could be the original intervals and new interval?
AOriginal: [[1,3],[7,9]], New: [2,6]
BOriginal: [[1,3],[6,9]], New: [2,5]
COriginal: [[1,2],[6,9]], New: [3,5]
DOriginal: [[1,4],[6,9]], New: [3,5]
Step-by-Step Solution
Solution:
  1. Step 1: Analyze merged intervals

    Merged interval [1,5] suggests original intervals and new interval overlap to cover 1 to 5.
  2. Step 2: Check options

    Original: [[1,4],[6,9]], New: [3,5] merges [1,4] and [3,5] into [1,5], with [6,9] separate, matching output.
  3. Final Answer:

    Option D -> Option D
  4. Quick Check:

    Only Original: [[1,4],[6,9]], New: [3,5] merges correctly to given output [OK]
Quick Trick: Merged intervals reflect union of overlapping original and new intervals [OK]
Common Mistakes:
MISTAKES
  • Not verifying overlap ranges carefully
Trap Explanation:
PITFALL
  • Candidates may pick options that don't merge correctly to final intervals.
Interviewer Note:
CONTEXT
  • Tests deep understanding by reasoning backwards from output to input.
Master "Insert Interval" in Intervals

3 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Intervals Quizzes