input: Write a python function to remove duplicate characters from a string while preserving the order of first occurrences.
  assert remove_duplicates("aaabbcdefg") == "abcdefg"
  assert remove_duplicates("aabbccddeeff") == "abcdef"
  assert remove_duplicates("abcdabcd") == "abcd"
  assert remove_duplicates("aabbcc") == "abc"
output: def remove_duplicates(s):
      seen = set()
      result = []
      for char in s:
          if char not in seen:
              seen.add(char)
              result.append(char)
      return ''.join(result)