input: from typing import List
  
  
  def remove_duplicates(string: str) -> str:
      """ Remove all consecutive duplicate characters from the given string.
      >>> remove_duplicates("AAABBCCCD")
      'ABCD'
      >>> remove_duplicates("A")
      'A'
      >>> remove_duplicates("AABBCC")
      'ABC'
      """
output:     result = []
      for char in string:
          if not result or char != result[-1]:
              result.append(char)
      return ''.join(result)