input: Write a python function to extract all external links from a given URL.
  assert extract_external_links('https://example.com') == ['https://example.com/external-link1', 'https://anotherdomain.com/external-link2']
  assert extract_external_links('https://anotherexample.com') == ['https://anotherexample.com/external-link1']
  assert extract_external_links('https://nodomain.com') == []
output: def extract_external_links(url):
      import requests
      from bs4 import BeautifulSoup
      from urllib.parse import urlparse, urljoin
  
      response = requests.get(url)
      soup = BeautifulSoup(response.text, 'html.parser')
  
      domain = urlparse(url).netloc
      external_links = []
  
      for link in soup.find_all('a', href=True):
          href = link['href']
          if href.startswith('http'):
              link_domain = urlparse(href).netloc
              if link_domain != domain:
                  external_links.append(href)
          elif href.startswith('/'):
              full_url = urljoin(url, href)
              link_domain = urlparse(full_url).netloc
              if link_domain != domain:
                  external_links.append(full_url)
      
      return external_links