This question evaluates proficiency in interval manipulation, array-based data structures, algorithm design, and time/space complexity analysis, focusing on merging overlapping numeric ranges into non-overlapping sorted intervals.
You are given an array of intervals, where each interval is represented as a pair of integers [start, end] with start <= end. The intervals may be unsorted and may overlap.
Task:
Example:
Constraints (you may assume reasonable values if not specified by the interviewer):
Design an algorithm to perform this merge efficiently and discuss its time and space complexity.