input: Write a function to optimize the given Python code that removes duplicates from a list using built-in functions. The function should loop through the array, append unique elements to a new list, and return the new list. If the input array is empty, it should return an empty list.
  assert removeDuplicates([1, 2, 2, 3, 4, 4]) == [1, 2, 3, 4]
  assert removeDuplicates([4, 4, 2, 1, 2, 3]) == [4, 2, 1, 3]
  assert removeDuplicates([]) == []
output: def removeDuplicates(arr):
      return list(dict.fromkeys(arr))