input: Write a function to optimize the given Python code to use built-in functions. The original function removes duplicates from an array by iterating through it and popping duplicate elements. The optimized function should use built-in functions to achieve the same result in a more efficient way. If the input array is empty, return an empty list.
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([1, 1, 1, 1, 1])==[1]
  assert removeDuplicates(['a', 'b', 'b', 'c', 'c', 'c'])==['a', 'b', 'c']
  assert removeDuplicates([])==[]
  assert removeDuplicates([5, 5, 4, 4, 3, 3, 2, 2, 1, 1])==[5, 4, 3, 2, 1]
output: def removeDuplicates(arr):
      return list(dict.fromkeys(arr))