Merge overlapping time intervals | Meta Interview Question