This isn't Kotlin specific, more of a general func...
# announcements
p
This isn't Kotlin specific, more of a general functional question. If I have a collection (items) and I want to do a 1-1 transformation, I'd use map
items.map { mapMethod }
to do a 1-1 transformation on
items
If I want to do a 1-N transformation, I'd use flatMap to turn each item into 1 or more newItems What if I need to turn
items
of length N into M new items (M < N) where each newItem could be made from 1 or more item? Is there a functional way to do that?