Process time intervals and detect overlaps/gaps | Sierra Interview Question