input: def html_to_text(html_string: str) -> str:
      """
      Convert an HTML string to a plain text string without using any libraries.
  
      >>> html_to_text('<p>Hello, <b>world</b>!</p>')
      'Hello, world!'
      >>> html_to_text('<div><h1>Title</h1><p>Paragraph</p></div>')
      'TitleParagraph'
      """
output:     import re
  
      # Remove HTML tags
      text = re.sub(r'<[^>]+>', '', html_string)
  
      # Remove extra spaces
      text = re.sub(r'\s+', ' ', text).strip()
  
      return text