```ts
/**
 * Merge overlapping or touching intervals into