input: Write a function to optimize the given Python code to use built-in functions for removing duplicates from an array. The function should return the array with all duplicates removed. If the input array is empty, the function should return an empty array.
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([5, 5, 5, 5])==[5]
  assert removeDuplicates([])==[]
  assert removeDuplicates([10, 20, 30, 40, 50])==[10, 20, 30, 40, 50]
  assert removeDuplicates([1, 1, 2, 2, 3, 3, 4, 4, 5, 5])==[1, 2, 3, 4, 5]
output: def removeDuplicates(arr):
      return list(dict.fromkeys(arr))