```public inline fun <T, K> Iterable<T&gt...
# codereview
m
Copy code
public inline fun <T, K> Iterable<T>.distinctLatestBy(selector: (T) -> K): List<T> {
    val set = HashMap<K, T>()
    for (e in this) {
        val key = selector(e)
        set[key] = e
    }
    return ArrayList(set.values)
}