Given `intervals` as an array of `[start, end]` pairs, implement `merge(intervals)` returning the non-overlapping intervals after merging overlaps, sorted by start.
Run your code to see results.