Given an array of intervals, merge all overlapping intervals and return the non-overlapping result.
Example: becomes because and overlap. You're solving a foundational interval problem.
While you can solve it with sorting alone, understanding it prepares you for harder interval tree problems. Constraints: up to intervals, values up to .