input: Write a function to optimize the given Python code that removes duplicates from an array using built-in functions. If the given array is empty, return an empty array.
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([5, 3, 3, 2, 1, 1, 2])==[5, 3, 2, 1]
  assert removeDuplicates([7, 8, 9, 8, 7])==[7, 8, 9]
  assert removeDuplicates([])==[]
  assert removeDuplicates([1, 1, 1, 1])==[1]
output: def removeDuplicates(arr):
      return list(dict.fromkeys(arr))