Merge overlapping time intervals efficiently | OpenAI