input: Write a function to optimize the given Python code to use built-in functions. If the input function is to remove duplicates from an array, implement this using efficient built-in functions.
  assert removeDuplicates([1, 2, 2, 3, 4, 4])==[1, 2, 3, 4]
  assert removeDuplicates([5, 5, 6, 7, 7, 8])==[5, 6, 7, 8]
  assert removeDuplicates([9, 10])==[9, 10]
  assert removeDuplicates([])==[]
  assert removeDuplicates([1])==[1]
  assert removeDuplicates([2, 2, 2, 2])==[2]
output: def removeDuplicates(arr):
      return list(dict.fromkeys(arr))