Write a function to merge overlapping time intervals representing reserved parking slots for Justpark.
Treat each interval as [start, end] and merge intervals that overlap or touch. Return a new list of non-overlapping intervals sorted by start time.
Function signature: def merge_intervals(intervals):. The input is a list of two-element lists, and the output has the same shape. An empty input returns an empty list.
def merge_intervals(intervals):