Hi Is there a way to intersect an unknown number ...
# announcements
j
Hi Is there a way to intersect an unknown number of list ?
n
Something along these lines should work (this specific code comes with no warranty :))
Copy code
lists.reduce { a, b ->
    a.intersect(b).toList()
}
For more information on reduce: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/reduce.html
j
thanks