kotlin.collections.reduceRightIndexed

reduceRightIndexed

inline fun <S, T : S> List<T>.reduceRightIndexed(
    operation: (index: Int, T, acc: S) -> S
): S

Accumulates value starting with last element and applying operation from right to left to each element with its index in the original list and current accumulator value.