duplicates

fun <T> List<T>.duplicates(): List<T>

Returns a set containing all elements that are contained more than once in this collection.

Return

A Set of the duplicate elements.