Kotlin HashSet runningFoldIndexed()
Syntax & Examples


Syntax of HashSet.runningFoldIndexed()

The syntax of HashSet.runningFoldIndexed() extension function is:

fun <T, R> Iterable<T>.runningFoldIndexed( initial: R, operation: (index: Int, acc: R, T) -> R ): List<R>

This runningFoldIndexed() extension function of HashSet returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original collection and current accumulator value that starts with initial value.