input: 
  def remove_duplicates(string: str) -> str:
      """ Removes all consecutive duplicate characters from the given string.
  
      >>> remove_duplicates("AAABBCCCD")
      "ABCD"
      >>> remove_duplicates("aabccbaa")
      "abcba"
      """
      result = ""
      prev = ''
      for char in string:
          if char != prev:
              result += char
              prev = char
      return result
  
output:     result = ""
      prev = ''
      for char in string:
          if char != prev:
              result += char
              prev = char
      return result