input: Write a function to optimize the given Python code to use built-in functions. If the given method removes duplicates from an array by iterating through the array and checking for duplicates, update the method to use a more efficient approach using built-in functions. If the array is empty, the function should return an empty array.
  assert removeDuplicates([1, 1, 2, 3, 3, 4, 5, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([5, 6, 7, 5, 7])==[5, 6, 7]
  assert removeDuplicates([3, 3, 3, 3])==[3]
  assert removeDuplicates([2, 3, 4])==[2, 3, 4]
  assert removeDuplicates([])==[]
output: def removeDuplicates(arr):
      return list(dict.fromkeys(arr))