Bayer interview question

Write an algorithm to merge adjacent timeboxes into continuous intervals.