solve merge intervals