input: Write a function that optimizes the given Python code to use built-in functions. The original function removes duplicate elements from a given array. The function should return the optimized version of the function.
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([1, 1, 1, 1])==[1]
  assert removeDuplicates([])==[]
  assert removeDuplicates([1, 2, 3, 4, 5])==[1, 2, 3, 4, 5]
output: def removeDuplicates(arr):
      return list(dict.fromkeys(arr))