input: Write a function to optimize the given Python code that removes duplicates from an array using built-in functions. The original code uses nested loops and list manipulation. The optimized code should be more efficient and use list comprehensions or built-in functions.
  
  ### Function:
  def removeDuplicates(array): 
      finalArray = []
      for element in array: 
          if element not in finalArray: 
              finalArray.append(element)
      return finalArray
  
  ### 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([1])==[1]
output: def removeDuplicates(array): 
      return list(dict.fromkeys(array))