input: Write a function to optimize a given Python function that removes duplicates from an array using built-in functions. The original function iterates through the array and removes duplicate elements using a nested loop. The optimized function should achieve the same result but in a more efficient manner.
  
  ### Original Function:
  
  def removeDuplicates(array): 
      for i in range (len(array)): 
          for j in range (i + 1, len(array)): 
              if array[i] == array[j]: 
                  array.pop(j)
  
  
  ### Optimized Function:
  
  def removeDuplicates(array): 
      return list(set(array))
  
  
  ### Test Cases:
  
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]
  assert removeDuplicates([5, 5, 5, 5, 5]) == [5]
  assert removeDuplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]
  assert removeDuplicates([]) == []
  assert removeDuplicates([10, 20, 30, 20, 10]) == [10, 20, 30]
  
  
  ### Output:
  The optimized function should return an array with all duplicates removed, preserving the original order of elements wherever possible.
output: def removeDuplicates(array): 
      seen = set()
      result = []
      for item in array:
          if item not in seen:
              seen.add(item)
              result.append(item)
      return result