input: Write a function to optimize the given Python code using built-in functions. The original code removes duplicates from an array by iterating over the list and manually checking for duplicates. The optimized function should achieve the same result using more efficient built-in methods.
  
  def removeDuplicates(array): 
      return list(dict.fromkeys(array))
  
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates(['a', 'b', 'b', 'c', 'd', 'd'])==['a', 'b', 'c', 'd']
  assert removeDuplicates([10, 10, 10])==[10]
  assert removeDuplicates([])==[]
  assert removeDuplicates([5, 3, 4, 3, 4, 5])==[5, 3, 4]
output: def removeDuplicates(array): 
      return list(dict.fromkeys(array))