input: Write a function to optimize the following Python code to use built-in functions.
  
  ### Original Code:
  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 Code:
  def removeDuplicates(array): 
      finalArray = []
      for element in array: 
          if element not in finalArray: 
              finalArray.append(element)
      return finalArray
  
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([1, 1, 1, 1, 1])==[1]
  assert removeDuplicates([5, 6, 7, 7, 8])==[5, 6, 7, 8]
  assert removeDuplicates([])==[]
  assert removeDuplicates([1])==[1]
output: def removeDuplicates(array): 
      return list(dict.fromkeys(array))