E.g. for List(1, 1, 1, 2, 3, 3, 4) it would be Set(1, 3), because 1 and 3 are the only elements which occur multiple times.
List(1, 1, 1, 2, 3, 3, 4)
Set(1, 3)
val s = List(1, 1, 1, 2, 3, 3, 4) // a list with non-unique elements (s diff s.distinct) toSet // Set(1, 3)