Returns array with duplicate elements removed