Merge Intervals

Programming Interview Hard 4 views
Back to Questions

Problem Description

Input provides {x}. Write function merge(intervals) and output merged intervals sorted.

Input Format

First line n. Next n lines: l r.

Output Format

Merged intervals lines.

Sample Test Case

Input:
4 1 3 2 6 8 10 9 11
Output:
1 6 8 11

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next