Just because we use a functional processing function, does not stop us from using indices. Let's learn about withIndex and indexed variants of important functions.
Another part of the collection processing articles series written by
@marcinmoskala.
https://kt.academy/article/fk-cp-indexed