https://kotlinlang.org logo
#getting-started
Title
# getting-started
u

uhe

12/02/2016, 9:12 PM
or if you want the element itself
fun <T> List<T>.firstDuplicate() = HashSet<T>().let { set -> firstOrNull { !set.add(it) } }
👍 2