input: from typing import List
  
  def remove_duplicates(nums: List[int]) -> List[int]:
      """ Removes duplicates from a list.
      >>> remove_duplicates([1, 2, 3, 4, 3, 2, 1])
      [1, 2, 3, 4]
      """
output:     seen = set()
      result = []
      for num in nums:
          if num not in seen:
              seen.add(num)
              result.append(num)
      return result