input: Write a function to optimize the given Python code that removes duplicate elements from an array using built-in functions. The function should take an array as input and return a new array with all duplicates removed, preserving the order of the first appearance of each element. If the input array is empty, the function should return an empty array.
  assert removeDuplicates([1, 2, 2, 3, 4, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([10, 10, 20, 30, 30, 40])==[10, 20, 30, 40]
  assert removeDuplicates([5, 5, 5, 5, 5])==[5]
  assert removeDuplicates([1, 2, 3, 4, 5])==[1, 2, 3, 4, 5]
  assert removeDuplicates([])==[]
output: def removeDuplicates(arr):
      seen = set()
      result = []
      for item in arr:
          if item not in seen:
              seen.add(item)
              result.append(item)
      return result