input: Write a function to remove all consecutive duplicates from a given string. If the input string is empty, return an empty string. Then, provide the following test cases with expected outputs:
  
  assert remove_duplicates("AAABBCCCD") == "ABCD"
  assert remove_duplicates("A") == "A"
  assert remove_duplicates("") == ""
  assert remove_duplicates("ABBA") == "ABA"
  assert remove_duplicates("aaa") == "a"
output: def remove_duplicates(s):
      if not s:
          return ""
      result = [s[0]]
      for char in s[1:]:
          if char != result[-1]:
              result.append(char)
      return ''.join(result)