kotlin.collections.distinctBy
distinctBy
inline fun <T, K> Iterable<T>.distinctBy( selector: (T) -> K ): List<T>
Returns a list containing only elements from the given collection having distinct keys returned by the given selector function.
The elements in the resulting list are in the same order as they were in the source collection.