https://github.com/night-codes/2_merge_intervals
https://github.com/night-codes/2_merge_intervals
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/night-codes/2_merge_intervals
- Owner: night-codes
- Created: 2020-01-15T12:55:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-18T00:33:57.000Z (over 5 years ago)
- Last Synced: 2024-04-16T08:56:04.938Z (about 1 year ago)
- Language: Go
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Task 2: Merge Intervals
The input is a list of intervals (two integer points); write a function/method that merges any N intervals in the list that have common points (intervals [1, 3] and [3, 6] have a common point of 3; [4, 8] and [6, 10] have common points of 6, 7, 8) and returns the merged list (where no two intervals intersect). it is allowed to modify the input. Try to avoid allocating extra memory for the output.