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