input: Write a function to remove duplicate characters from a given string and return the result. The function should iterate through each character in the string and add it to the result if it hasn't been seen before. The function should also use a set to keep track of characters that have already been seen.
  
  def remove_duplicate_characters(string):
      result = ""
      seen = set()
      for char in string:
          if char not in seen:
              seen.add(char)
              result += char
      return result
  
  assert remove_duplicate_characters("bufferoverflow") == "bufrewov"
  assert remove_duplicate_characters("helloworld") == "helowrd"
  assert remove_duplicate_characters("pythonprogramming") == "pythongraming"
  assert remove_duplicate_characters("") == ""
  assert remove_duplicate_characters("a") == "a"
output: def remove_duplicate_characters(string):
      result = ""
      seen = set()
      for char in string:
          if char not in seen:
              seen.add(char)
              result += char
      return result