merge intervals solved