How can get both unique & duplications values from the array in python

I have an array in which I have both unique and duplicated values.

With my current implementation, I’m getting the list of unique & duplicated values, but I want to get also existing unique values (values with no duplication) from the array.

array = [2,4,2,4,88,98,88,100,33,100]


def algo(array):
   duplicate = []
   unique = []
   superunique = []

   for item in array:
      if item in unique:
         duplicate.append(item)            
      else:            
         unique.append(item)
   
   print("Duplicate values: ", duplicate)
   print("Unique Values: ", unique)


print(algo(array))

My current result is:

Duplicate values: [2, 4, 88, 100] Unique Values: [2, 4, 88, 98, 100, 33]

And I want to get also existing unique values that are already in the array

Existing Unique Values = [98, 33] ==> desire result

Answer

You should be using the set data structure for this kind of operations.

print("Existing unique values :" , set(unique) - set(duplicate))