input: Write a function that takes a list as input and returns a new list with all duplicate elements removed while preserving the order of the first occurrence of each element. The function should involve a linear scan of the list and memory usage should be minimal. If the input list is empty, return an empty list.
  
  assert remove_duplicates([1, 2, 3, 4, 3, 2, 1])==[1, 2, 3, 4]
  assert remove_duplicates([4, 5, 4, 6, 5, 7])==[4, 5, 6, 7]
  assert remove_duplicates([1, 1, 1, 1])==[1]
  assert remove_duplicates([])==[]
output: def remove_duplicates(lst):
      seen = set()
      result = []
      for item in lst:
          if item not in seen:
              seen.add(item)
              result.append(item)
      return result