Kotlin HashSet partition()
Syntax & Examples
Syntax of HashSet.partition()
The syntax of HashSet.partition() extension function is:
fun <T> Iterable<T>.partition( predicate: (T) -> Boolean ): Pair<List<T>, List<T>>
This partition() extension function of HashSet splits the original collection into pair of lists, where first list contains elements for which predicate yielded true, while second list contains elements for which predicate yielded false.