Log in
← All problems

Merge intervals

hardSorting and searching40 XP

Each interval is [start, end]. Merge all intervals that overlap or touch, and return the result sorted by start.

Examples

Examples use JSON: true/false/null are True/False/None in Python.

Run examples checks the examples above. Submit also runs 3 hidden tests.