input: Write a function to optimize the given Python code to use built-in functions for removing duplicates from an array. The optimized function should return a list with no duplicate elements, in the order they appear in the input array.
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([5, 5, 5, 5, 5])==[5]
  assert removeDuplicates([6, 7, 8, 9])==[6, 7, 8, 9]
  assert removeDuplicates([])==[]
  assert removeDuplicates([3, 3, 1, 1, 2, 2])==[3, 1, 2]
output: def removeDuplicates(arr):
      return list(dict.fromkeys(arr))