input: from typing import List
  
  def removeDuplicates(array: List[int or float]) -> List[int or float]:
      """Optimize the given function to remove duplicates in an array using built-in functions.
      >>> removeDuplicates([1, 2, 2, 3, 4, 4, 5])
      [1, 2, 3, 4, 5]
      >>> removeDuplicates([1.0, 2.0, 2.0, 3.0, 4.0, 4.0, 5.0])
      [1.0, 2.0, 3.0, 4.0, 5.0]
      """
output:     return list(dict.fromkeys(array))