Given a sorted list of non-overlapping intervals and a new interval, insert it and merge if necessary.
Input: intervals=[[1,3],[6,9]], newInterval=[2,5] Output: [[1,5],[6,9]] Input: intervals=[[1,2],[3,5],[6,7],[8,10]], newInterval=[4,8] Output: [[1,2],[3,10]]
Unlock hints progressively — start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features