input: Write a function to optimize the provided Python code to use built-in functions for removing duplicates from an array. The function should return a new array with all duplicates removed, while maintaining the order of elements as they appear in the original array. If the input array is empty, it should return an empty array.
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]
  assert removeDuplicates([1, 1, 1, 1, 1]) == [1]
  assert removeDuplicates([]) == []
  assert removeDuplicates([7, 7, 3, 2, 2, 5, 5, 1]) == [7, 3, 2, 5, 1]
output: def removeDuplicates(arr):
      seen = set()
      return [x for x in arr if not (x in seen or seen.add(x))]