fun <T, R> Iterator<T>.mapRemainingWithCounter(transform: (index: Int, T) -> R): List<R> (source)
Maps remaining values of this Iterator with the help of the given transform functions where a counter variable
is passed ot the transform function starting by 0; returns an empty list if Iterator.hasNext returns false
for the first call.
Return
A List of the mapped remaining values.