input: Write a function to remove all consecutive duplicates from a given string. If the input string is empty, return an empty string.
  assert remove_duplicates("AAABBCCCD")=="ABCD"
  assert remove_duplicates("A")=="A"
  assert remove_duplicates("AAAA")=="A"
  assert remove_duplicates("")==""
  assert remove_duplicates("ABABABA")=="ABABABA"
output: def remove_duplicates(s):
      if not s:
          return ""
      result = s[0]
      for i in range(1, len(s)):
          if s[i] != s[i-1]:
              result += s[i]
      return result